Threaded::extend
PHP function
Edit on GitHub ✎
(PECL pthreads >= 2.0.8)
Runtime Manipulation
Description
Threaded::extend(string $class): bool
Makes thread safe standard class at runtime
Parameters
classThe class to extend
Return Values
Success
Examples
Runtime inheritance
php
<?php
class My {}
Threaded::extend(My::class);
$my = new My();
var_dump($my instanceof Threaded);
?>The above example will output:
output
bool(true)