Exemplo n.º 1
0
}
echo "    Pull -> ";
$val = null;
try {
    $val = $testPriorityQueue->pull();
    echo "{$val}\n";
} catch (\Exception $e) {
    echo "EXCEPTION CAUGHT!\n";
}
echo "\nQueue Internals --\n\n";
var_dump($testPriorityQueue->getList());
echo "\n";
echo "   Delete ('air') -> ";
$success = true;
try {
    $testPriorityQueue->delete('air');
} catch (\Exception $e) {
    $success = false;
}
if ($success) {
    echo "Success!\n";
} else {
    echo "Failure...\n";
}
echo "\nQueue Internals --\n\n";
var_dump($testPriorityQueue->getList());
echo "\n";
echo "   Delete Priority (5 'water') -> ";
$success = true;
try {
    $testPriorityQueue->deletePriority(5);