#41584 [NEW]: SimpleXML emits wrong spurious notice...

From: Date: Mon, 04 Jun 2007 10:09:37 +0000
Subject: #41584 [NEW]: SimpleXML emits wrong spurious notice...
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113337@lists.php.net to get a copy of this message
From: judas dot iscariote at gmail dot com Operating system: any PHP version: 5CVS-2007-06-04 (CVS) PHP Bug Type: SimpleXML related Bug description: SimpleXML emits wrong spurious notice... Description: ------------ [different problem, but a follow up of bug 41582 The following code emits a wrong notice, rendering this stuff more or less useless in write context... Reproduce code: --------------- <?php $xml = new SimpleXMLElement('<?xml version="1.0" standalone="yes"?> <collection></collection>'); $xml->movie[0]->characters->character[0]->name = 'Miss Coder'; $xml->movie[0]->characters->character[1]->name = 'ouch'; var_dump($xml->asXML()); Expected result: ---------------- string(%d) "<?xml version="1.0" standalone="yes"?> <collection><movie><characters><character><name>Miss Coder</name></character><character><name>ouch</name></character></characters></movie></collection> " Actual result: -------------- PHP Notice: Indirect modification of overloaded element of SimpleXMLElement has no effect in /home/cristian/simplecrashes.php on line 6 string(151) "<?xml version="1.0" standalone="yes"?> <collection><movie><characters><character><name>Miss Coder</name></character></characters></movie></collection> " -- Edit bug report at http://bugs.php.net/?id=41584&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41584&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41584&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41584&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41584&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41584&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41584&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41584&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41584&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41584&r=support Expected behavior: http://bugs.php.net/fix.php?id=41584&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41584&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41584&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41584&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41584&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41584&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41584&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41584&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41584&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41584&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41584&r=mysqlcfg

« previous php.bugs (#113337) next »