Esempio n. 1
0
 /**
  * Destructor.
  */
 public function __destruct()
 {
     parent::__destruct();
 }
Esempio n. 2
0
 public function __construct($debug = FALSE)
 {
     parent::__construct();
     $this->size = 0;
 }
Esempio n. 3
0
        }
        printf("%s\n", str($queue));
        printf("Using reduce\n");
        $queue->reduce(create_function('$sum,$obj', 'printf("%s\\n", str($obj));'), '');
        printf("Using foreach\n");
        foreach ($queue as $obj) {
            printf("%s\n", str($obj));
        }
        printf("getHead\n");
        printf("%s\n", str($queue->getHead()));
        printf("Dequeueing\n");
        while (!$queue->isEmpty()) {
            printf("%s\n", str($queue->dequeue()));
        }
    }
    /**
     * Main program.
     *
     * @param array $args Command-line arguments.
     * @return integer Zero on success; non-zero on failure.
     */
    public static function main($args)
    {
        printf("AbstractQueue main program.\n");
        $status = 0;
        return $status;
    }
}
if (realpath($argv[0]) == realpath(__FILE__)) {
    exit(AbstractQueue::main(array_slice($argv, 1)));
}
Esempio n. 4
0
 /**
  * Main program.
  *
  * @param array $args Command-line arguments.
  * @return integer Zero on success; non-zero on failure.
  */
 public static function main($args)
 {
     printf("QueueAsArray main program.\n");
     $status = 0;
     $queue = new QueueAsArray(5);
     AbstractQueue::test($queue);
     return $status;
 }
Esempio n. 5
0
File: LIFO.php Progetto: philip/Buzz
 public function __construct()
 {
     parent::__construct('array_push', 'array_pop');
 }