Variable reference counting problem variable reference makes people get confused what reference, separation, write copy, write change ...... for example: & lt ;? Php $ a & nbsp; 1; $ B & nbsp; & amp; & nbsp; $ a; xdebug_debug_zval (a); debug_zval_dump ($ ); * result B: (refcount2, & nbsp; is_ref1), I variable reference count
Variable references make people go crazy.
What is the reference, separation, and replication during writing? changes during writing .....
For example:
$ A = 1;
$ B = & $;
Xdebug_debug_zval ('A ');
Debug_zval_dump ($ );
/* Result
B:
(Refcount = 2, is_ref = 1), int 1
Long (1) refcount (1)
*/
The refcount test results are different. is xdebug accurate or built-in debug_zval_dump accurate?
------ Solution ----------------------
Call debug_zval_dump ($ a); when the form parameter and $ a are separated, call debug_zval_dump can be referred to the following situation
$ A = 1;
$ B = & $
$ C = $
------ Solution ----------------------
Reference http://www.laruence.com/2008/09/19/520.html
------ Solution ----------------------
The refcount in the report of the two functions is not a meaning
Please do not be confused by a thorough article.
------ Solution ----------------------
Reference:
Are these two functions used to view reference counts?
View the application count
Debug_zval_dump ($ a); use the reference method debug_zval_dump (& $ a). because your call is similar to the following situation, read/write splitting occurs. $ c has been separated from $.
$ A = 1;
$ B = & $
$ C = $
Xdebug_debug_zval is the reference count, while debug_zval_dump is the reference count + 1 because it transmits parameters to it.