← All docs

ptr_write_string()

Copies PHP string bytes into raw memory at the given pointer.

ptr_write_string()

function ptr_write_string(pointer $pointer, string $string): int

Copies PHP string bytes into raw memory at the given pointer.

Parameters:

  • $pointer (pointer)
  • $string (string)

Returns: int

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_write_string is implemented in the compiler, see the internals page.