PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Carlos Blanco Domínguez  >  Polymorphic Stack  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: Polymorphic Stack
Implement a LIFO stack with arrays
Author: By
Last change:
Date: 15 years ago
Size: 310 bytes


Class file image Download

$s=&new stack();

$i=1;$i<=10; $i+=2) $s->push($i);


printf("The top of the stack is %d <br>",$s->top());
printf("The number of elements of the stack is %d <br>",$s->count());

while (!
$s->isempty()) printf("Poped element %d , ",$s->pop());

For more information send a message to info at phpclasses dot org.