Annotation of embedaddon/php/ext/simplexml/tests/bug66084_1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #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
! 8: echo json_encode(simplexml_load_string('<a><b/><c><x/></c></a>')), "\n";
! 9: echo json_encode(simplexml_load_string('<a><b/><d/><c><x/></c></a>')), "\n";
! 10: echo json_encode(simplexml_load_string('<a><b/><c><d/><x/></c></a>')), "\n";
! 11: echo 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":{}}}}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>