Bug #67909 [NEW]: simplexml_load_string() mangles empty node name for specific xml structure

From: Date: Tue, 26 Aug 2014 15:24:31 +0000
Subject: Bug #67909 [NEW]: simplexml_load_string() mangles empty node name for specific xml structure
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187280@lists.php.net to get a copy of this message
From: evgeniy dot arsenyev at gmail dot com Operating system: CENTOS 7 PHP version: 5.5.16 Package: SimpleXML related Bug Type: Bug Bug description:simplexml_load_string() mangles empty node name for specific xml structure Description: ------------ This bug is pretty similar to Bug #66084 : simplexml_load_string() incorrectly interprets some XML strings. For specific inputs with empty nodes, node names are converted to integers. Original bug was fixed, but the same bug appears on a slightly different XML string '<a><c><inner/></c><c><inner>ddd</inner></c></a>'. Test script: --------------- print_r(simplexml_load_string('<a><c><inner/></c><c><inner>ddd</inner></c></a>')); Expected result: ---------------- SimpleXMLElement Object ( [c] => Array ( [0] => SimpleXMLElement Object ( [inner] => SimpleXMLElement Object ( ) ) [1] => SimpleXMLElement Object ( [inner] => dd ) ) ) Actual result: -------------- SimpleXMLElement Object ( [c] => Array ( [0] => SimpleXMLElement Object ( [0] => SimpleXMLElement Object ( ) ) [1] => SimpleXMLElement Object ( [inner] => ddd ) ) ) -- Edit bug report at https://bugs.php.net/bug.php?id=67909&edit=1 --

« previous php.bugs (#187280) next »