File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / simplexml / tests / bug66084_0.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 20:03:55 2014 UTC (10 years, 2 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29, HEAD
php 5.4.29

--TEST--
Bug #66084 simplexml_load_string() mangles empty node name, var_dump variant
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip simplexml not available"; ?>
--FILE--
<?php
echo var_dump(simplexml_load_string('<a><b/><c><x/></c></a>')), "\n";
echo var_dump(simplexml_load_string('<a><b/><d/><c><x/></c></a>')), "\n";
echo var_dump(simplexml_load_string('<a><b/><c><d/><x/></c></a>')), "\n";
echo var_dump(simplexml_load_string('<a><b/><c><d><x/></d></c></a>')), "\n";
?>
--EXPECT--
object(SimpleXMLElement)#1 (2) {
  ["b"]=>
  object(SimpleXMLElement)#2 (0) {
  }
  ["c"]=>
  object(SimpleXMLElement)#3 (1) {
    ["x"]=>
    object(SimpleXMLElement)#4 (0) {
    }
  }
}

object(SimpleXMLElement)#1 (3) {
  ["b"]=>
  object(SimpleXMLElement)#3 (0) {
  }
  ["d"]=>
  object(SimpleXMLElement)#2 (0) {
  }
  ["c"]=>
  object(SimpleXMLElement)#4 (1) {
    ["x"]=>
    object(SimpleXMLElement)#5 (0) {
    }
  }
}

object(SimpleXMLElement)#1 (2) {
  ["b"]=>
  object(SimpleXMLElement)#4 (0) {
  }
  ["c"]=>
  object(SimpleXMLElement)#2 (2) {
    ["d"]=>
    object(SimpleXMLElement)#3 (0) {
    }
    ["x"]=>
    object(SimpleXMLElement)#5 (0) {
    }
  }
}

object(SimpleXMLElement)#1 (2) {
  ["b"]=>
  object(SimpleXMLElement)#2 (0) {
  }
  ["c"]=>
  object(SimpleXMLElement)#4 (1) {
    ["d"]=>
    object(SimpleXMLElement)#5 (1) {
      ["x"]=>
      object(SimpleXMLElement)#3 (0) {
      }
    }
  }
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>