update page now
Laravel Live Japan

FFI::string

(PHP 7 >= 7.4.0, PHP 8)

FFI::stringメモリ領域から PHP の文字列を作成する

説明

public static FFI::string(FFI\CData &$ptr, ?int $size = null): string

ptr が指すメモリ領域の size バイト分から PHP の string を作成します。

パラメータ

ptr

string を作成する元となるメモリ領域の開始位置。

size

string へコピーするバイト数。 size を省略したり null を指定したりする場合、 ptr はゼロ終端された C の char 配列でなければなりません。

戻り値

新しく作成された PHP の string

変更履歴

バージョン 説明
8.0.0 size が nullable になりました。以前は 0 がデフォルトでした。
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top