array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'ffi.cast.php', 1 => 'FFI::cast', ), 'up' => array ( 0 => 'class.ffi.php', 1 => 'FFI', ), 'prev' => array ( 0 => 'ffi.arraytype.php', 1 => 'FFI::arrayType', ), 'next' => array ( 0 => 'ffi.cdef.php', 1 => 'FFI::cdef', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ffi/ffi/cast.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 7 >= 7.4.0, PHP 8)
FFI::cast — Performs a C type cast
FFI::cast() creates a new FFI\CData
object, that references the same C data structure, but is associated with a different type.
The resulting object does not own the C data, and the source ptr
must survive the result. The C type may be specified as a string with any
valid C type declaration or as FFI\CType object, created before.
Any type declared for the instance is allowed.
Returns the freshly created FFI\CData object.
バージョン | 説明 |
---|---|
8.3.0 | Calling FFI::cast() statically is now deprecated. |