1

I'm having trouble with dumping DOMDocument objects with var_dump. As example:

$DOMDocumentNode = new DOMDocument();
$DOMDocumentNode->loadXML('<example a="b">Test</example>');
$DOMElementNode = $DOMDocumentNode->documentElement;
$DOMAttributeNode = $DOMElementNode->getAttributeNode('a');
$DOMTextNode = $DOMElementNode->firstChild;

error_reporting(0);
var_dump($DOMDocumentNode, $DOMElementNode, $DOMAttributeNode, $DOMTextNode);

And the result is:

object(DOMDocument)[1]

object(DOMElement)[2]

object(DOMAttr)[3]

object(DOMText)[4]

My enviroment is (I normally work through PHPStorm) :

Linux version 3.5.0-32-generic (buildd@lamiak) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #53~precise1-Ubuntu SMP Wed May 29 20:35:31 UTC 2013

Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:    12.04
Codename:   precise

PHP 5.4.15-1~precise+1 (cli) (built: May 12 2013 16:02:23) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

I've checked far and wide, but none of the answers here on Google seem to help. I came checked http://bugs.xdebug.org/view.php?id=913 and also run the attached test from https://github.com/xdebug/xdebug/blob/master/tests/bug00913.phpt . Nearest thing I came was quite different Debug a DOMDocument Object in PHP

Which results in:

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

What I'm doing wrong?

EDIT: As requested the phpinfo() on xdebug

Directive   Local Value Master Value
xdebug.auto_trace   Off Off
xdebug.cli_color    0   0
xdebug.collect_assignments  Off Off
xdebug.collect_includes On  On
xdebug.collect_params   0   0
xdebug.collect_return   Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable  On  On
xdebug.default_enable   On  On
xdebug.dump.COOKIE  no value    no value
xdebug.dump.ENV no value    no value
xdebug.dump.FILES   no value    no value
xdebug.dump.GET no value    no value
xdebug.dump.POST    no value    no value
xdebug.dump.REQUEST no value    no value
xdebug.dump.SERVER  no value    no value
xdebug.dump.SESSION no value    no value
xdebug.dump_globals On  On
xdebug.dump_once    On  On
xdebug.dump_undefined   Off Off
xdebug.extended_info    On  On
xdebug.file_link_format no value    no value
xdebug.idekey   no value    no value
xdebug.max_nesting_level    100 100
xdebug.overload_var_dump    On  On
xdebug.profiler_aggregate   Off Off
xdebug.profiler_append  Off Off
xdebug.profiler_enable  Off Off
xdebug.profiler_enable_trigger  Off Off
xdebug.profiler_output_dir  /tmp    /tmp
xdebug.profiler_output_name cachegrind.out.%p   cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back  Off Off
xdebug.remote_cookie_expire_time    3600    3600
xdebug.remote_enable    Off Off
xdebug.remote_handler   dbgp    dbgp
xdebug.remote_host  localhost   localhost
xdebug.remote_log   no value    no value
xdebug.remote_mode  req req
xdebug.remote_port  9000    9000
xdebug.scream   Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars  Off Off
xdebug.show_mem_delta   Off Off
xdebug.trace_enable_trigger Off Off
xdebug.trace_format 0   0
xdebug.trace_options    0   0
xdebug.trace_output_dir /tmp    /tmp
xdebug.trace_output_name    trace.%c    trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth    3   3
Community
  • 1
  • 1
user1927033
  • 142
  • 14
  • I just checked this with xdebug 2.2.3 and php 5.4.15, and it works just fine. I'd suggest you try 2.2.3 and see whether it works. – Derick Jun 22 '13 at 12:48
  • @Derick just tried out, removed php5-xdebug and installed 2.2.3 from pear - same output. However due to using ondrej's ppa it's currently 5.4.17RC1. Also tried 5.4.7 with 2.2.1 (from xamp bundle on win machine) and again the same result... – user1927033 Jun 27 '13 at 07:03
  • Tested Fedora 18 with PHP 5.4.16 and xdebug 2.2.3 - same issue. – user1927033 Jun 27 '13 at 15:56
  • Post your phpinfo() section on Xdebug please to the question. – Derick Jun 27 '13 at 22:31
  • As requested added the info. Also just test Fedora 19 with remi repository (PHP 5.5.0 (cli) (built: Jun 20 2013 09:19:00) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0-dev, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans ) and the result is the same.... – user1927033 Jul 11 '13 at 07:58

0 Answers0