Req #76611 [NEW]: Printing DOMNode shows fake "(object value omitted)" strings

From: Date: Wed, 11 Jul 2018 17:45:27 +0000
Subject: Req #76611 [NEW]: Printing DOMNode shows fake "(object value omitted)" strings
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216276@lists.php.net to get a copy of this message
From:             chealer at gmail dot com
Operating system: 
PHP version:      7.2.7
Package:          DOM XML related
Bug Type:         Feature/Change Request
Bug description:Printing DOMNode shows fake "(object value omitted)" strings

Description:
------------
The DOM extension's DOMNode class seems to hide object properties when
DOMNode objects are displayed.

For example, the following shows that print_r() presents the lastChild
property as a string "(object value omitted)", but also that this
property is in fact a DOMElement object when directly printed.

This affects Xdebug and makes it painful to debug the DOM extension.

https://3v4l.org/NFpRS shows that this persists in 7.3.0 alpha
1.

Test script:
---------------
<?php

$dom = new DOMDocument();
$dom->loadHTML('<h1>Configuration</h1>', LIBXML_HTML_NOIMPLIED |
LIBXML_HTML_NODEFDTD);
print_r($dom);
print_r($dom->lastChild);

Actual result:
--------------
DOMDocument Object
(
    [doctype] => 
    [implementation] => (object value omitted)
    [documentElement] => (object value omitted)
    [actualEncoding] => 
    [encoding] => 
    [xmlEncoding] => 
    [standalone] => 1
    [xmlStandalone] => 1
    [version] => 
    [xmlVersion] => 
    [strictErrorChecking] => 1
    [documentURI] => 
    [config] => 
    [formatOutput] => 
    [validateOnParse] => 
    [resolveExternals] => 
    [preserveWhiteSpace] => 1
    [recover] => 
    [substituteEntities] => 
    [nodeName] => #document
    [nodeValue] => 
    [nodeType] => 13
    [parentNode] => 
    [childNodes] => (object value omitted)
    [firstChild] => (object value omitted)
    [lastChild] => (object value omitted)
    [previousSibling] => 
    [attributes] => 
    [ownerDocument] => 
    [namespaceURI] => 
    [prefix] => 
    [localName] => 
    [baseURI] => 
    [textContent] => Configuration
)
DOMElement Object
(
    [tagName] => h1
    [schemaTypeInfo] => 
    [nodeName] => h1
    [nodeValue] => Configuration
    [nodeType] => 1
    [parentNode] => (object value omitted)
    [childNodes] => (object value omitted)
    [firstChild] => (object value omitted)
    [lastChild] => (object value omitted)
    [previousSibling] => 
    [attributes] => (object value omitted)
    [ownerDocument] => (object value omitted)
    [namespaceURI] => 
    [prefix] => 
    [localName] => h1
    [baseURI] => 
    [textContent] => Configuration
)


-- 
Edit bug report at https://bugs.php.net/bug.php?id=76611&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=76611&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=76611&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=76611&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=76611&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=76611&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=76611&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=76611&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=76611&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=76611&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=76611&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=76611&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=76611&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=76611&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76611&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=76611&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=76611&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=76611&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76611&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=76611&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=76611&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#216276) next »