debug_zval_dump()
debug_zval_dump() — Dumps a string representation of an internal zval structure to output.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Dumps a string representation of an internal zval (Zend value) structure to output. This is mostly useful for understanding or debugging implementation details of the Zend Engine or PHP extensions.
Signature
debug_zval_dump(mixed $value, mixed ...$values): void
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $value | mixed | The variable or value to dump. |
| ...$values | mixed | Further variables or values to dump. |
Return value
No value is returned.
Example
A runnable snippet:
$var1 = 'Hello'; $var1 .= ' World'; $var2 = $var1; debug_zval_dump($var1);
Output:
string(11) "Hello World" refcount(3)
Changelog
| Version | Change |
|---|---|
| 8.4.0 | debug_zval_dump() now indicates whether an array is packed. |
See also
All PHP 8.5 built-in functions
Reference card built from the PHP manual page debug_zval_dump() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.