php8.5
Home/ Manual/ pthreads / threaded/ Threaded::count

Threaded::count

PHP function Edit on GitHub ✎

(PECL pthreads >= 2.0.0)

Manipulation

Description

Threaded::count(): int

Returns the number of properties for this object

Parameters Parameters

Return Values

Examples

Counting the properties of an object

php
<?php
$safe = new Threaded();

while (count($safe) < 10) {
    $safe[] = count($safe);
}

var_dump(count($safe));
?>

The above example will output:

output
int(10)

Source: reference/pthreads/threaded/count.xml · from the official PHP manual (php/doc-en)