K2hQueue Class K2hQueue::count

K2hQueue::__construct

Creates a K2hQueue instance

Description

public K2hQueue::__construct ( mixed $handle_res [, bool $is_fifo [, string $prefix ]] )

Creates a K2hQueue instance.

Parameters

Examples

<?php
$handle = k2hpx_open_mem();
$k2hqueue = new K2hQueue($handle, true, "test_queue_");
var_dump($k2hqueue->count());
$k2hqueue->push("test_queue_data");
var_dump($k2hqueue->count());
var_dump($k2hqueue->pop());
var_dump($k2hqueue->count());
unset($k2hqueue);
k2hpx_close($handle);
?>

The above example will output:

int(0)
int(1)
string(15) "test_queue_data"
int(0)

See Also

K2hQueue Class K2hQueue::count