PHP 8.5.0 Released!

FFI::arrayType

(PHP 7 >= 7.4.0, PHP 8)

FFI::arrayType新しい C の配列型を動的に構築する

説明

public static FFI::arrayType(FFI\CType $type, array $dimensions): FFI\CType

type で指定された要素型と dimensions で指定された次元を持つ 新しい C の配列型を動的に構築します。以下の例において $t1$t2 は等しい配列型です。

<?php
$t1
= FFI::type("int[2][3]");
$t2 = FFI::arrayType(FFI::type("int"), [2, 3]);
?>

パラメータ

type

有効な C の宣言を表す string か、作成済みの FFI\CType のインスタンス。

dimensions

型の次元を表す array

戻り値

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

add a note

User Contributed Notes

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