Bug #70026 [Opn]: Instances of DOMDocument lose derived class information when refcount low

From: Date: Fri, 10 Jul 2015 16:04:37 +0000
Subject: Bug #70026 [Opn]: Instances of DOMDocument lose derived class information when refcount low
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194317@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70026&edit=1 ID: 70026 Updated by: cmb@php.net Reported by: dexen dot devries at gmail dot com Summary: Instances of DOMDocument lose derived class information when refcount low Status: Open Type: Bug Package: DOM XML related Operating System: Linux PHP Version: 5.6.10 Block user comment: N Private report: N New Comment: That seems to be related to bug #61797. Previous Comments: ------------------------------------------------------------------------ [2015-07-08 15:18:21] dexen dot devries at gmail dot com Description: ------------ DOMXPath instances mis-handle instances of classes derived from DOMDocument in some cases, as accessible via $document property. Instances of classes derived from DOMDocument can suffer loss of information, both on derived class type and properties of the derived class. Both derived class name and properties of instance of the derived class are lost. Problems seems to be related to refcount going down to zero; can be reliably triggered both by returning instance of DOMDocument derived class from function, and by manually unset()ting all variables refering to the instance of class derived from DOMDocument. Test script: --------------- http://pastebin.ca/3051231 Expected result: ---------------- Instance of DOMXPath should hold the original DOMDocument instances in $document property. Actual result: -------------- Instance of DOMXPath holds some sort of copy of DOMDocument instance in $document, if refcount goes to zero, resulting in loss of both derived class information, and properties of the derived class. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70026&edit=1

« previous php.bugs (#194317) next »