Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2006-06-09 16:38
Size: 310 bytes
 

Contents

Class file image Download
<?php
require_once("stack.php");

$s=&new stack();

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

$s->debug();

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());
?>