Answer the question
In order to leave comments, you need to log in
Error in xdebug documentation?
Good day to all! Somehow it so accidentally happened that along the chain " Questions for an interview " (paragraph Copy-on-write) -> an article with a more detailed explanation -> PHP documentation -> hdebug extension documentation, I found a discrepancy between theory and practice. According to the documentation, the code
$a = "new string";
xdebug_debug_zval('a');
a: (refcount=1, is_ref=0)='new string'
a: (interned, is_ref=0)='new string'
$a = array(1, 2, 3);
$b =& $a;
$c =& $a[2];
xdebug_debug_zval('a');
xdebug_debug_zval("a[2]");
a: (refcount=2, is_ref=1)=array (
0 => (refcount=1, is_ref=0)=1,
1 => (refcount=1, is_ref=0)=2,
2 => (refcount=2, is_ref=1)=3)
a[2]: (refcount=2, is_ref=1)=3
a: (refcount=2, is_ref=1)=array (
0 => (refcount=0, is_ref=0)=1,
1 => (refcount=0, is_ref=0)=2,
2 => (refcount=2, is_ref=1)=3)
a[2]: (refcount=2, is_ref=1)=3
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question