Bug #61858 [Ver->Csd]: DOMAttr debug info generates E_WARNING
| From: | nikic@php.net | Date: | Tue, 10 Jan 2017 22:25:54 +0000 |
| Subject: | Bug #61858 [Ver->Csd]: DOMAttr debug info generates E_WARNING | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206478@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61858&edit=1
ID: 61858
Updated by: nikic@php.net
Reported by: salathe@php.net
Summary: DOMAttr debug info generates E_WARNING
-Status: Verified
+Status: Closed
Type: Bug
Package: DOM XML related
PHP Version: 5.4.1
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of arnoutboks@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=07340553a562db2387c9995dce0c84dd9afba97e
Log: Fixed bug #61858 (DOMAttr debug info generates E_WARNING)
Previous Comments:
------------------------------------------------------------------------
[2016-12-07 17:46:40] obeobe at zoho dot com
This issue happens when doing something as simple as:
$attribute = $element->getAttributeNode($attributeName);
Still not fixed in PHP 5.6.
In PHP 7 the behavior is a little different - I don't see an actual warning but it kills xdebug
(tracing a couple of line after calling a function that would throw an E_WARNING in PHP 5.6 causes
the trace to immediately exit the current function and go back to the parent stack frame).
Unless I find a way to work around this - I won't be able to work with DOMDocument.
How come it wasn't fixed for more than 4 years?? It seems pretty trivial as it's just
debugging code!
------------------------------------------------------------------------
[2013-12-02 14:57:47] mike@php.net
It tries to fetch DomAttr->schemaTypeInfo (DOM3) which results in the "not implemented"
warning.
------------------------------------------------------------------------
[2012-05-25 12:08:04] arjen at react dot com
In 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.10, 5.4.0 not
warning was generated, while both objects were printed as if the are empty.
In 5.3.11 - 5.3.13, 5.4.1 - 5.4.3 the content IS printed, AND a warning is
generated.
http://3v4l.org/OcEGX
------------------------------------------------------------------------
[2012-04-26 13:48:18] salathe@php.net
Description:
------------
Trying var_dump()/print_r() a DOMAttr prints an E_WARNING message "Not yet
implemented".
Test script:
---------------
<?php
$doc = new DOMDocument();
$doc->loadXML('<example a="b">Test</example>');
$example = $doc->getElementsByTagName('example')->item(0);
$attr = $example->getAttributeNode('a');
var_dump($attr);
print_r($attr);
Expected result:
----------------
object(DOMAttr)#2 (20) {
["name"]=>
string(1) "a"
["specified"]=>
bool(true)
["value"]=>
string(1) "b"
["ownerElement"]=>
string(22) "(object value omitted)"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(1) "a"
["nodeValue"]=>
string(1) "b"
["nodeType"]=>
int(2)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["attributes"]=>
NULL
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(1) "a"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(1) "b"
}
DOMAttr Object
(
[name] => a
[specified] => 1
[value] => b
[ownerElement] => (object value omitted)
[schemaTypeInfo] =>
[nodeName] => a
[nodeValue] => b
[nodeType] => 2
[parentNode] => (object value omitted)
[childNodes] => (object value omitted)
[firstChild] => (object value omitted)
[lastChild] => (object value omitted)
[previousSibling] =>
[attributes] =>
[ownerDocument] => (object value omitted)
[namespaceURI] =>
[prefix] =>
[localName] => a
[baseURI] => /
[textContent] => b
)
Actual result:
--------------
Warning: var_dump(): Not yet implemented in /tmp/php-OE78FO on line 9
object(DOMAttr)#2 (20) {
["name"]=>
string(1) "a"
["specified"]=>
bool(true)
["value"]=>
string(1) "b"
["ownerElement"]=>
string(22) "(object value omitted)"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(1) "a"
["nodeValue"]=>
string(1) "b"
["nodeType"]=>
int(2)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["attributes"]=>
NULL
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(1) "a"
["baseURI"]=>
string(1) "/"
["textContent"]=>
string(1) "b"
}
DOMAttr Object
Warning: print_r(): Not yet implemented in /tmp/php-OE78FO on line 10
(
[name] => a
[specified] => 1
[value] => b
[ownerElement] => (object value omitted)
[schemaTypeInfo] =>
[nodeName] => a
[nodeValue] => b
[nodeType] => 2
[parentNode] => (object value omitted)
[childNodes] => (object value omitted)
[firstChild] => (object value omitted)
[lastChild] => (object value omitted)
[previousSibling] =>
[attributes] =>
[ownerDocument] => (object value omitted)
[namespaceURI] =>
[prefix] =>
[localName] => a
[baseURI] => /
[textContent] => b
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61858&edit=1