Laravel Live Japan

FFI::scope

(PHP 7 >= 7.4.0, PHP 8)

FFI::scope事前ロード中にパースされた C の宣言を使って FFI オブジェクトをインスタンス化する

説明

public static FFI::scope(string $name): FFI

事前ロード中にパースされた C の宣言を使って FFI オブジェクトをインスタンス化します。

FFI::scope() メソッドを同じスコープに対して複数回呼んでも安全です。 同じスコープを指す複数の参照は同時に読み込まれるかもしれません。

パラメータ

name

特殊な FFI_SCOPE define によって定義されたスコープ名。

戻り値

新しく作成された FFI オブジェクトを返します。

参考

  • FFI::load() - C のヘッダーファイルから C の宣言を読み込む

add a note

User Contributed Notes 1 note

up
0
mh at hanft dot de
2 years ago
I have found out that FFI::scope only works with Apache when you select Apache's threading model "prefork".  Using any other threading model results in "scope not found" (and you have to use FFI::load instead because preloading seems not to be possible in this case).
To Top