04-22-2008, 11:02 PM
|
#2 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
After looking at the relevant PHP source code (in ext/standard/var.c for those interested) it appears as though your assumption is correct. debug_zval_dump simply displays the associated refcount whereas var_dump does not.
As for your code snippet, debug_zval_dump would report a refcount of 4, believe it or not. Once (1) for the first assignment of "Hello" to $var1. Another (2) for the assign-by-reference to $var2. Another (3) for the assign-by-reference to $var3. Finally another (4) reference is made when calling debug_zval_dump.
|
|
|
|