Bug #77685 [Opn->Dup]: Property reflection fails for DOMElement::$firstChild

From: Date: Tue, 21 Apr 2020 11:32:56 +0000
Subject: Bug #77685 [Opn->Dup]: Property reflection fails for DOMElement::$firstChild
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226700@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77685&edit=1 ID: 77685 Updated by: cmb@php.net Reported by: gtisza at gmail dot com Summary: Property reflection fails for DOMElement::$firstChild -Status: Open +Status: Duplicate Type: Bug Package: Reflection related PHP Version: 7.3.2 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Marking as duplicate of bug #79065 (of which this is a special case). Previous Comments: ------------------------------------------------------------------------ [2019-03-01 06:59:42] gtisza at gmail dot com Description: ------------ Trying to use reflection for the firstChild property of a DOMElement throws a "Property DOMElement::$firstChild does not exist" ReflectionException. Live test: https://3v4l.org/oQWMn This is particularly disruptive when using PHPSpec, which wraps all property access into reflection checks. Test script: --------------- $doc = new DOMDocument; $doc->loadHTML('<html><body></body></html>'); $e = $doc->getElementsByTagname('html')->item(0); echo get_class($e->firstChild); // DOMElement new ReflectionProperty('DOMElement', 'firstChild'); // throws ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77685&edit=1

« previous php.bugs (#226700) next »