<?php
/**
* Example of using queue for PHP 4
*/
// Include queue class
require_once( 'queue.class.php4' );
// Test item queue class
class ItemTest
{
var $id = 0;
function __construct( $id )
{
$this->id = $id;
}
}
$objQueue = new Queue;
// Adding some items to queue
for ( $i = 1; $i <= 15; $i ++ )
{
$objQueue->Put( new ItemTest( $i ) );
}
// Geting items from queue and printing them
while ( $result = $objQueue->Get() )
{
print $result->id."<br>";
}
?>
|