Threaded::extend

Runtime Manipulation

説明

public bool Threaded::extend(string $class)

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)