|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-21 15:11 UTC] phpwnd at gmail dot com
[2008-09-30 15:57 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
Description: ------------ SimplyXML fails to load element attributes and values Tried with PHP 5.2.5 and 5.2.6, on Linux and Windows systems and got the same result. Reproduce code: --------------- <?php $xmlstr = <<<XML <?xml version="1.0"?> <test> <optgroup label="Non-Teen"> <option value="5">Under 5</option> <option value="9">Five to Ten</option> </optgroup> <optgroup label="Teen"> <option value="10">Aspiring Teen</option> <option value="15">Mid Teen</option> <option value="19">End Teen</option> </optgroup> </test> XML; $xml = new SimpleXMLElement($xmlstr); print_r ($xml); ?> Expected result: ---------------- The $xml array should have a SimpleXMLElement containing the "value" attribute for each "option" element Actual result: -------------- The "value" attributes of the "option" elements are not being loaded in the $xml array