From: sunco007 at hotmail dot com Operating system: Vista Business PHP version: 5.2.6 PHP Bug Type: SimpleXML related Bug description: Can't set a variable that i get from Xml
Description: ------------ I create a Xml file and when i want to read some values it just return a blank value. I you do an echo to every value works fine, but when you put all togheter is when it fails The same if you read directly from a file or from a var (simplexml_load_file or simplexml_load_string) Reproduce code: --------------- <? $values = '<?xml version="1.0" encoding="ISO-8859-1" ?> <root> <nota> <url><![CDATA[opinion.php?id=16619&extra=m]]></url> <plaza>MZT</plaza> </nota> </root>'; $xml = simplexml_load_string($values); foreach ($xml->nota as $datos) { // work echo "-".$datos->plaza."-<br>"; // work echo "-".$datos->url."-<br>"; // put together $malecon_link[$datos->plaza] = $datos->url; // don't work echo "-".$malecon_link[$datos->plaza]."-<br>"; } ?> Expected result: ---------------- $malecon_link[$datos->plaza] must return the value, in this case the url Actual result: -------------- Return a blank value -- Edit bug report at http://bugs.php.net/?id=46306&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46306&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46306&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46306&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46306&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=46306&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46306&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46306&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46306&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46306&r=support Expected behavior: http://bugs.php.net/fix.php?id=46306&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46306&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46306&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46306&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46306&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46306&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46306&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46306&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46306&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46306&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46306&r=mysqlcfg