K2hQueue::isEmpty
Returns whether the K2hQueue is empty
Description
public bool K2hQueue::isEmpty ( void )
Returns where the K2hQueue is empty.
Parameters
This function has no parameters.
Return Values
Returns true if the K2hQueue object is empty, otherwise false.
Examples
- Example 1 - Gets an element of a K2hQueue instance
<?php
$handle = k2hpx_open_mem();
$k2hqueue = new K2hQueue($handle, true, "test_queue_");
var_dump($k2hqueue->isEmpty());
$k2hqueue->push("test_queue_data");
var_dump($k2hqueue->isEmpty());
var_dump($k2hqueue->pop());
var_dump($k2hqueue->isEmpty());
unset($k2hqueue);
k2hpx_close($handle);
?>
The above example will output:
bool(true)
bool(false)
string(15) "test_queue_data"
bool(true)