php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay
files >> /opt/php-7.0.1/ext/dom/tests/ |
files >> //opt/php-7.0.1/ext/dom/tests/regsiter_node_class.phpt |
--TEST-- Test: registerNodeClass() --SKIPIF-- <?php require_once('skipif.inc'); ?> --FILE-- <?php class myAttribute extends DOMAttr { function testit() { return "HELLO Attribute"; } } class myElement extends DOMElement { function testit() { return "HELLO Element"; } } $doc = new DOMDocument(); $doc->registerNodeClass('DOMAttr', 'myAttribute'); $doc->registerNodeClass('DOMElement', 'myElement'); $doc->appendChild(new DOMElement('root')); $root = $doc->documentElement; $root->setAttribute('a', 'a1'); echo get_class($root), "\n"; print $root->testit()."\n"; $attr = $root->getAttributeNode('a'); echo get_class($attr), "\n"; print $attr->testit()."\n"; unset($attr); $doc->registerNodeClass('DOMAttr', NULL); $attr = $root->getAttributeNode('a'); echo get_class($attr), "\n"; print $attr->testit()."\n"; ?> --EXPECTF-- myElement HELLO Element myAttribute HELLO Attribute DOMAttr Fatal error: Uncaught Error: Call to undefined method DOMAttr::testit() in %s:25 Stack trace: #0 {main} thrown in %s on line 25y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`