array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'class.ffi-cdata.php', 1 => 'FFI\\CData', ), 'up' => array ( 0 => 'book.ffi.php', 1 => 'FFI', ), 'prev' => array ( 0 => 'ffi.typeof.php', 1 => 'FFI::typeof', ), 'next' => array ( 0 => 'class.ffi-ctype.php', 1 => 'FFI\\CType', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/ffi/ffi.cdata.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7 >= 7.4.0, PHP 8)
Les objets FFI\CData peuvent être utilisés de différentes manières, comme des données PHP normale :
$x = FFI::new('int'); $x->cdata = 42;
$cdata->field
$cdata[$offset]
$cdata[0]
<
,
<=
, ==
, !=
, >=
, >
).
+
/-
/ / ).
++
/–-
, par exemple $cdata += 5
-
.
$cdata()
$cdata2 = clone $cdata;
Note: Les limitations notables sont que les instances de FFI\CData ne supportent pas les fonctions isset(), empty() et unset(), et que les structs et unions C enveloppés n'implémentent pas Traversable.
Version | Description |
---|---|
8.3.0 | FFI\CData peut maintenant être attribué à des structures et des champs. |