(PHP 7 >= 7.4.0, PHP 8)
FFI\CData objects can be used in a number of ways as a regular PHP data:
$x = FFI::new('int'); $x->cdata = 42;
$cdata->field
$cdata[$offset]
foreach
statements.
$cdata[0]
<
,
<=
, ==
, !=
, >=
, >
).
+
/-
/
++
/--
operations, e.g. $cdata += 5
-
operations.
$cdata()
$cdata2 = clone $cdata;
Note: Notable limitations are that FFI\CData instances do not support isset(), empty() and unset(), and that wrapped C structs and unions do not implement Traversable.
Version | Description |
---|---|
8.3.0 | FFI\CData can now be assigned to structs and fields. |
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant