#44266 [NEW]: classes inheriting from SimpleXMLElement cannot have properties

From: Date: Wed, 27 Feb 2008 14:07:24 +0000
Subject: #44266 [NEW]: classes inheriting from SimpleXMLElement cannot have properties
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122746@lists.php.net to get a copy of this message
From: m dot beyer5 at gmx dot de Operating system: Linux PHP version: 5.2.5 PHP Bug Type: SimpleXML related Bug description: classes inheriting from SimpleXMLElement cannot have properties Description: ------------ Classes inheriting from SimpleXMLElements should be able to have class properties the same way any other class does. Currently SimpleXML treats operations on class properties as operations on the xml part of the object. There should be a way to adress both seperately. Reproduce code: --------------- class Foo extends SimpleXMLElement { public $bar; } $str = "<xml></xml>"; $foo = new Foo($str); $foo->bar = array(); Expected result: ---------------- Assigning anything to Foo->bar should not affect the XML part but should be handled as a normal class property. Actual result: -------------- SimpleXMLElement tries to interpret the public variable as an XML Element, causing a warning: Warning: It is not yet possible to assign complex types to properties -- Edit bug report at http://bugs.php.net/?id=44266&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44266&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44266&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44266&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44266&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44266&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44266&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44266&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44266&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44266&r=support Expected behavior: http://bugs.php.net/fix.php?id=44266&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44266&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44266&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44266&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44266&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44266&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44266&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44266&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44266&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44266&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44266&r=mysqlcfg

« previous php.bugs (#122746) next »