« Threaded::count
Threaded::isRunning »

Threaded::extend

(PECL pthreads >= 2.0.8)

Threaded::extend — Runtime Manipulation

説明

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

Makes thread safe standard class at runtime

パラメータ

class

The class to extend

戻り値

成功した場合に true を、失敗した場合に false を返します。

例

例1 Runtime inheritance

<?php
class My {}

Threaded::extend(My::class);

$my = new My();

var_dump($my instanceof Threaded);
?>

上の例の出力は以下となります。

bool(true)
関連キーワード:
Threaded   extend   Runtime   Manipulation   count   isRunning   pthreads   Makes   thread   safe   standard   runtime   成功   inheritance   dump   instanceof
関連する関数・ページ:
threaded.count   class.threaded   threaded.pop   threaded.run   threaded.shift   threaded.merge