|
debug_zval_dump
Dumps a string representation of an internal zend value to output
(PHP 4 >= 4.2.0, PHP 5)
ExamplesExample 2579. debug_zval_dump() example<?php The above example will output: string(11) "Hello World" refcount(3)
Beware the refcount:
The This behavior is further compounded when a variable is not passed to debug_zval_dump() by reference. To illustrate, consider a slightly modified version of the above example: Example 2580.<?php The above example will output: string(11) "Hello World" refcount(1)
Why
This function becomes even more confusing when a
variable with a Example 2581.<?php The above example will output: string(11) "Hello World" refcount(2)
A
When a variable has a single reference (as did
So, if debug_zval_dump() happened to write to its sole
parameter (and it doesn't), then a copy would be made. Until then, the
parameter remains a reference, causing the Code Examples / Notes » debug_zval_dumpilpochta
First link [Reference Counting and Aliasing (by Andi Gutmans)] not work, see it in web-archive http://tinyurl.com/ytvrjt |
Change Languagedebug_zval_dump doubleval empty floatval get_defined_vars get_resource_type gettype import_request_variables intval is_array is_binary is_bool is_buffer is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string is_unicode isset print_r serialize settype strval unserialize unset var_dump var_export |