FFI::cast
(PHP 7 >= 7.4.0, PHP 8)
FFI::cast — Performs a C type cast
Description
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.
Parameters
Return Values
Returns the freshly created FFI\CData object.
Changelog
| Version | Description |
|---|---|
| 8.3.0 | Calling FFI::cast() statically is now deprecated. |
↑ and ↓ to navigate • Enter to select • Esc to close • / to open