|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65565 var_dump of DOM objects displays empty objects
Submitted: 2013-08-27 16:16 UTC Modified: 2017-01-11 03:21 UTC
From: Laurent dot Lyaudet at gmail dot com Assigned: requinix (profile)
Status: Closed Package: DOM XML related
PHP Version: 5.4.19 OS: Debian Linux
Private report: No CVE-ID: None
 [2013-08-27 16:16 UTC] Laurent dot Lyaudet at gmail dot com

If you var_dump a DOMElement, a DOMNodeList, etc. you have an empty object displayed like that :
DOMElement#130 (0) {

Best regards,
   Laurent Lyaudet


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-27 16:38 UTC] Laurent dot Lyaudet at gmail dot com
Note that the use of Reflection doesn't yield the content either.
Some methods are listed but no property is.
 [2013-08-28 08:13 UTC] Laurent dot Lyaudet at gmail dot com
The bug for the reflection part was already reported in bug 48527.
 [2013-12-02 16:22 UTC]
-Type: Bug +Type: Feature/Change Request
 [2014-04-14 14:13 UTC]
This is strange.
The commit is into PHP5.4 tree, since 5.4.1

Are you sure about your PHP version ?
 [2014-05-02 18:39 UTC] Laurent dot Lyaudet at gmail dot com

I did a second test today with Debian Wheezy updated-upgraded.
It didn't work :

root@wheezyDEVLaurent:~# php --version
PHP 5.4.4-14+deb7u9 (cli) (built: Apr 18 2014 14:34:31)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
root@wheezyDEVLaurent:~# php
$oDOMElement = new DOMElement('balise');
class DOMElement#1 (0) {

I also tested it on Ubuntu Trusty with PHP 5.5.9 and it worked.
I don't know why it doesn't work in Debian. Maybe the commit did not make it to the stable version of Debian.

Since it seems to work in later versions, feel free to close the bug.
I'll continue to use work-arounds with Wheezy.

Best regards,
   Laurent Lyaudet
 [2017-01-10 20:36 UTC] arnout dot boks at moxio dot com
This is fixed in recent PHP versions, as is verified by e.g.
 [2017-01-11 03:21 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: requinix
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Feb 24 23:01:27 2024 UTC