K2hQueue::__construct K2hQueue Class K2hQueue::dump

K2hQueue::count

Counts elements in the K2hQueue object

Description

public intfalseK2hQueue::count ( void )

Counts the number of elements in the K2hQueue object.

Parameters

This function has no parameters.

Return Values

Returns the number of elements in the K2hQueue.

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::__construct K2hQueue Class K2hQueue::dump