xref: /PHP-5.4/ext/simplexml/tests/bug66084_1.phpt (revision a0beddf5)
1--TEST--
2Bug #66084 simplexml_load_string() mangles empty node name, json variant
3--SKIPIF--
4<?php if (!extension_loaded("simplexml")) print "skip simplexml not available"; ?>
5<?php if (!extension_loaded("json")) print "skip json not available"; ?>
6--FILE--
7<?php
8echo json_encode(simplexml_load_string('<a><b/><c><x/></c></a>')), "\n";
9echo json_encode(simplexml_load_string('<a><b/><d/><c><x/></c></a>')), "\n";
10echo json_encode(simplexml_load_string('<a><b/><c><d/><x/></c></a>')), "\n";
11echo json_encode(simplexml_load_string('<a><b/><c><d><x/></d></c></a>')), "\n";
12?>
13--EXPECT--
14{"b":{},"c":{"x":{}}}
15{"b":{},"d":{},"c":{"x":{}}}
16{"b":{},"c":{"d":{},"x":{}}}
17{"b":{},"c":{"d":{"x":{}}}}
18