Threaded::extend

(PECL pthreads >= 2.0.8)

Threaded::extendRuntime Manipulation

说锟斤拷

public Threaded::extend ( string $class ) : bool

Makes thread safe standard class at runtime

锟斤拷锟斤拷

class

The class to extend

锟斤拷锟斤拷值

A boolean indication of success

锟斤拷锟斤拷

Example #1 Runtime inheritance

<?php
class My {}

Threaded::extend(My::class);

$my = new My();

var_dump($my instanceof Threaded);
?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

bool(true)