From 07340553a562db2387c9995dce0c84dd9afba97e Mon Sep 17 00:00:00 2001 From: Arnout Boks Date: Tue, 10 Jan 2017 21:19:37 +0100 Subject: [PATCH] Fixed bug #61858 (DOMAttr debug info generates E_WARNING) It seems fair to remove this warning, given that: * it is not documented in the official documentation * the $specified property, which has a similar 'not implemented' status, also does not trigger a warning * it apparently hinders quite a lot of people during debugging, judging by the number of votes on the bug --- NEWS | 3 +++ ext/dom/attr.c | 2 +- ext/dom/tests/bug61858.phpt | 24 ++++++++++++++++++++++++ ext/dom/tests/dom_set_attr_node.phpt | 4 +--- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 ext/dom/tests/bug61858.phpt diff --git a/NEWS b/NEWS index fb75b0017b..a066036de7 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ PHP NEWS . Fixed bug #73876 (Crash when exporting **= in expansion of assign op). (Sara) +- Dom: + . Fixed bug #61858 (DOMAttr debug info generates E_WARNING). (Arnout Boks) + - GD: . Fixed bug #73893 (A hidden danger of death cycle in a function of gd). (cmb) diff --git a/ext/dom/attr.c b/ext/dom/attr.c index 40a10f2f3d..db70029004 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -213,7 +213,7 @@ Since: DOM Level 3 */ int dom_attr_schema_type_info_read(dom_object *obj, zval *retval) { - php_error_docref(NULL, E_WARNING, "Not yet implemented"); + /* TODO */ ZVAL_NULL(retval); return SUCCESS; } diff --git a/ext/dom/tests/bug61858.phpt b/ext/dom/tests/bug61858.phpt new file mode 100644 index 0000000000..ccdd0cd80c --- /dev/null +++ b/ext/dom/tests/bug61858.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #61858 DOMAttr debug info generates E_WARNING +--SKIPIF-- + +--FILE-- +loadXML('Test'); + +$example = $doc->getElementsByTagName('example')->item(0); +$attr = $example->getAttributeNode('a'); + +var_dump($attr); +print_r($attr); +--EXPECTF-- +object(DOMAttr)#%d (%d) { +%A +} +DOMAttr Object +( +%A +) diff --git a/ext/dom/tests/dom_set_attr_node.phpt b/ext/dom/tests/dom_set_attr_node.phpt index a426a6f3f8..18c697710a 100644 --- a/ext/dom/tests/dom_set_attr_node.phpt +++ b/ext/dom/tests/dom_set_attr_node.phpt @@ -61,9 +61,7 @@ object(DOMException)#%d (7) { ["args"]=> array(1) { [0]=> - -Warning: var_dump(): %s -DOMAttr + DOMAttr } } } -- 2.40.0