← All docs

ptr_read_string()

Copies raw bytes from a pointer into a PHP string of the given length.

ptr_read_string()

function ptr_read_string(pointer $pointer, int $length): string

Copies raw bytes from a pointer into a PHP string of the given length.

Parameters:

  • $pointer (pointer)
  • $length (int)

Returns: string

Availability

Compiled (AOT)Magician (eval)
AvailableAvailable
  • Hidden in strict PHP mode: this builtin is an elephc extension with no PHP equivalent, so programs compiled with --strict-php treat 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 ptr_read_string is implemented in the compiler, see the internals page.