← All docs
buffer_ptr()
Returns the payload address of a buffer<T>, valid until the buffer is freed.
buffer_ptr()
function buffer_ptr(buffer $buffer): pointer
Returns the payload address of a buffer
Parameters:
$buffer(buffer)
Returns: pointer
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported through a declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/raw_memory/buffer_ptr.rs).- Strict PHP mode: hidden - this builtin is an elephc extension with no PHP equivalent, so programs compiled with
--strict-phptreat the name as nonexistent, in compiled code and inside eval’d code.
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how buffer_ptr is implemented in the compiler, see the internals page.