View Issue Details

IDProjectCategoryView StatusLast Update
0001157XdebugDocumentationpublic2015-11-22 15:05
ReportervaughanyAssigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
PlatformLinuxOSUbuntuOS Version14.04
Product Version2.2.3 
Target VersionFixed in Version 
Summary0001157: Code in documentation does not output results seen in documentation
DescriptionHi there.

Using the code examples given in the documentation (here: http://xdebug.org/docs/all_functions) for 'xdebug_debug_zval' produces results that are different to the documentation or no results at all.

phpinfo() confirms that xdebug is loaded. Commands such as the overloaded var_dump work fine.
Steps To ReproduceExample 1:

<?php
$a = array(1, 2, 3);
$b =& $a;
$c =& $a[2];
xdebug_debug_zval('a');
?>

..should produce (according to the documentation):

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)

...but actually produces:

a:

(refcount=2, is_ref=1),
array (size=3)
  0 => (refcount=1, is_ref=0),int 1
  1 => (refcount=1, is_ref=0),int 2
  2 => (refcount=2, is_ref=1),int 3



Example 2:

<?php
$a = array(1, 2, 3);
$b =& $a;
$c =& $a[2];
xdebug_debug_zval("a[2]");
?>

...produces no output whatsoever.
Additional InformationI am aware that the current stable version and the version I am running may produce different results but I found it odd that a command produces no output whatsoever.

Xdebug installed with apt-get (php5-xdebug).
TagsNo tags attached.
Operating SystemUbuntu 14.04
PHP Version5.5.5-5.5.9

Activities

derick

2015-06-02 12:36

administrator   ~0003105

I will have to check the difference in output, but it makes sense that:

xdebug_debug_zval("a[2]");

Does not work in 2.2.x, as it's new functionality in 2.3.x.

vaughany

2015-06-02 13:14

reporter   ~0003106

Apologies, I didn't realise that was a feature in 2.3.x. Sorry about that.

I am seeing the a: on a different line, however, which is a minor formatting issue and hardly worth reporting!

derick

2015-11-22 15:05

administrator   ~0003255

The output can indeed be different, but I can't reproduce your output's format.
I get what's in the documentation.

And it makes sense that your example two produces no output, as in Xdebug 2.2
it only supports just variable names, and no array subscripts or property
access.

Issue History

Date Modified Username Field Change
2015-06-02 12:02 vaughany New Issue
2015-06-02 12:36 derick Note Added: 0003105
2015-06-02 13:14 vaughany Note Added: 0003106
2015-11-20 23:10 derick Category Usage problems => Documentation
2015-11-22 15:05 derick Note Added: 0003255
2015-11-22 15:05 derick Status new => resolved
2015-11-22 15:05 derick Resolution open => no change required
2015-11-22 15:05 derick Assigned To => derick