Bug #54991 [Ana->Wfx]: domimplementation instance is not a reference inside domdocument

From: Date: Sun, 22 Sep 2019 23:00:04 +0000
Subject: Bug #54991 [Ana->Wfx]: domimplementation instance is not a reference inside domdocument
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222883@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54991&edit=1 ID: 54991 Updated by: beberlei@php.net Reported by: giorgio dot liscio at email dot it Summary: domimplementation instance is not a reference inside domdocument -Status: Analyzed +Status: Wont fix Type: Bug Package: DOM XML related Operating System: any? PHP Version: 5.3.6 -Assigned To: +Assigned To: beberlei Block user comment: N Private report: N New Comment: ext/dom doesn't guarantee reference equality, new instances are often created from properties that behave more like "magic" __get returning new instances based on underlying data. For this case though, PHP DOMImplementation doesn't support any other implementation than the one in code. Also don't trust hasFeature on it, because that data is just hardcoded. Previous Comments: ------------------------------------------------------------------------ [2013-12-03 09:52:03] mike@php.net .) the objects created by DOMImplementation->create* do not reference the implementation .) dom_document_implementation_read() always creates a new DOMImplementation object ------------------------------------------------------------------------ [2011-06-04 13:00:44] giorgio dot liscio at email dot it class MyImplementation extends \DOMImplementation { function commonfunc() { echo "implementation"; } } $implementation = new MyImplementation(); $doc = $implementation->createDocument(); var_dump($doc->implementation === $implementation); // raises error: //doc->implementation->commonfunc(); ------------------------------------------------------------------------ [2011-06-04 11:33:38] giorgio dot liscio at email dot it Description: ------------ hi, there is a strange behavior with domimplementation and its reference inside domdocument: i can't determine if a domdocument is bound to a specific implementation, because $implementation = new \DOMImplementation(); $doc = $implementation->createDocument(); var_dump($doc->implementation === $implementation); // should be true, but it is false ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54991&edit=1

« previous php.bugs (#222883) next »