php8.5
Home/ Manual/ pthreads / thread/ Thread::join

Thread::join

PHP function Edit on GitHub ✎

(PECL pthreads >= 2.0.0)

Synchronization

Description

Thread::join(): bool

Causes the calling context to wait for the referenced Thread to finish executing

Parameters Parameters

Return Values

Success

Examples

Join with the referenced Thread

php
<?php
class My extends Thread {
    public function run() {
        /* ... */
    }
}
$my = new My();
$my->start();
/* ... */
var_dump($my->join());
/* ... */
?>

The above example will output:

output
bool(true)

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