Threaded::extend
(PECL pthreads >= 2.0.8)
Threaded::extend — Runtime Manipulation
Beschreibung
public bool Threaded::extend
( string
$class
)Makes thread safe standard class at runtime
Parameter-Liste
-
class -
The class to extend
Rückgabewerte
A boolean indication of success
Beispiele
Beispiel #1 Runtime inheritance
<?php
class My {}
Threaded::extend(My::class);
$my = new My();
var_dump($my instanceof Threaded);
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
bool(true)