K2hKeyQueue::count K2hKeyQueue Class K2hKeyQueue::isEmpty

K2hKeyQueue::dump

Prints the elements in the K2hKeyQueue object

Description

 public bool K2hKeyQueue::dump ([ mixed $output ] )

Gets the elements in the K2hKeyQueue object.

Parameters

Return Values

Returns true on success or false on failure.

Examples

<?php
$handle = k2hpx_open_mem();

$k2hkeyqueue = new K2hKeyQueue($handle, true, "test_queue_");
$k2hkeyqueue->push("test_queue_key", "test_queue_value");
$fp = fopen("/tmp/k2hkeyqueue_dump.log", 'w');
$k2hkeyqueue->dump($fp);
fclose($fp);
$fp = fopen("/tmp/k2hkeyqueue_dump.log", 'r');
if ($fp) {
        while (!feof($fp)) {
                if (($buf = fgets($fp, 4096)) !== false) {
                        echo $buf;
                }
        }
        fclose($fp);
}
unset($k2hkeyqueue);
k2hpx_close($handle);
?>

The above example will output:

bool(true)
MARKER(test_queue_MARKER)= {
        START KEY               = test_queue_00000000000071EC_0000000061D9D54D_0000000031DD32D2
        END KEY                 = test_queue_00000000000071EC_0000000061D9D54D_0000000031DD32D2
}
[0]                    = test_queue_00000000000071EC_0000000061D9D54D_0000000031DD32D2
K2hKeyQueue::count K2hKeyQueue Class K2hKeyQueue::isEmpty