|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-05 12:50 UTC] tony2001@php.net
[2005-07-11 15:03 UTC] chregu@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 23 23:00:01 2025 UTC |
Description: ------------ The function seems to return a the DB-Object twice. One of the Objects is valid, the other is missing data. Reproduce code: --------------- <?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <settings> <db> <user>root</user> <pw>topsecret</pw> <host>localhost</host> <type>mysql</type> <db>mydatabase</db> <fetchmode>3</fetchmode> <autocommit>on</autocommit> </db> </settings>'; $dom = new DomDocument($xml); $root = $dom->document_element(); print '<pre>'; var_dump($root->get_elements_by_tagname('db')); print '</pre>'; ?> Expected result: ---------------- array(1) { [0]=> object(domelement)#3 (4) { ["type"]=> int(1) ["tagname"]=> string(2) "db" [0]=> int(4) [1]=> int(22694840) } } or something similar... Actual result: -------------- array(2) { [0]=> object(domelement)#3 (4) { ["type"]=> int(1) ["tagname"]=> string(2) "db" [0]=> int(4) [1]=> int(22694840) } [1]=> object(domelement)#4 (4) { ["type"]=> int(1) ["tagname"]=> string(2) "db" [0]=> int(5) [1]=> int(22693552) } }