pthreads Threaded::extend

(PECL pthreads >= 2.0.8)

Threaded::extend — Runtime Manipulation


설명

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

런타임에 스레드로부터 안전한 표준 클래스를 만듭니다.


매개변수

class
확장할 클래스

반환 값

성공하면 true를, 실패하면 false를 반환합니다.


Examples

예제 #1 Runtime inheritance

                  
<?php
class My {}

Threaded::extend(My::class);

$my = new My();

var_dump($my instanceof Threaded);
?>
                  
                

위의 예는 다음을 출력합니다.

bool(true)