3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xmlstr = <<<XML <Property> <images> <image number="1"> <image>http://www.blah.net/shared/depot/3168/biens/149506/images/627783.jpg </image> <image number="2"> <image>http://www.blah.net/shared/depot/3168/biens/149506/images/627794.jpg</image> </image> <image number="3"> <image>http://www.blah.net/shared/depot/3168/biens/149506/images/627792.jpg </image> </images> </Property> XML; $xml = simplexml_load_string($xmlstr); //var_dump($xmlstr); foreach ($xml->images->image as $im) { // create an array $images with number as index and url as value var_dump ($im); } ?>
Output for 5.5.35, 5.6.21 - 5.6.28, 7.0.6 - 7.1.0
Warning: simplexml_load_string(): Entity: line 12: parser error : expected '>' in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): </images> in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): ^ in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Opening and ending tag mismatch: image line 3 and Property in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): </Property> in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): ^ in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Premature end of data in tag images line 2 in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): </Property> in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): ^ in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Premature end of data in tag Property line 1 in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): </Property> in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): ^ in /in/GBDZ2 on line 18 Notice: Trying to get property of non-object in /in/GBDZ2 on line 22 Notice: Trying to get property of non-object in /in/GBDZ2 on line 22 Warning: Invalid argument supplied for foreach() in /in/GBDZ2 on line 22
Output for 5.5.0 - 5.5.34, 5.6.0 - 5.6.20, 7.0.0 - 7.0.5
Warning: simplexml_load_string(): Entity: line 12: parser error : expected '>' in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): </images> in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): ^ in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Opening and ending tag mismatch: image line 3 and Property in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Premature end of data in tag images line 2 in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Premature end of data in tag Property line 1 in /in/GBDZ2 on line 18 Notice: Trying to get property of non-object in /in/GBDZ2 on line 22 Notice: Trying to get property of non-object in /in/GBDZ2 on line 22 Warning: Invalid argument supplied for foreach() in /in/GBDZ2 on line 22
Output for 5.2.3 - 5.4.45
Warning: simplexml_load_string(): Entity: line 12: parser error : expected '>' in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): </images> in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): ^ in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Opening and ending tag mismatch: image line 3 and Property in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Premature end of data in tag images line 2 in /in/GBDZ2 on line 18 Warning: simplexml_load_string(): Entity: line 13: parser error : Premature end of data in tag Property line 1 in /in/GBDZ2 on line 18 Warning: Invalid argument supplied for foreach() in /in/GBDZ2 on line 22
Output for 5.1.0 - 5.1.1, 5.1.3 - 5.2.2
<br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 12: parser error : expected '&gt;' in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: &lt;/images&gt; in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 13: parser error : Opening and ending tag mismatch: image line 3 and Property in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 13: parser error : Premature end of data in tag images line 2 in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 13: parser error : Premature end of data in tag Property line 1 in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/in/GBDZ2</b> on line <b>22</b><br />
Output for 5.1.2
<br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 12: parser error : expected '&gt;' in <b>/in/GBDZ2</b> on line <b>19</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: &lt;/images&gt; in <b>/in/GBDZ2</b> on line <b>19</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in <b>/in/GBDZ2</b> on line <b>19</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 13: parser error : Opening and ending tag mismatch: image line 3 and Property in <b>/in/GBDZ2</b> on line <b>19</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 13: parser error : Premature end of data in tag images line 2 in <b>/in/GBDZ2</b> on line <b>19</b><br /> <br /> <b>Warning</b>: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 13: parser error : Premature end of data in tag Property line 1 in <b>/in/GBDZ2</b> on line <b>19</b><br /> <br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/in/GBDZ2</b> on line <b>23</b><br />
Output for 5.0.0 - 5.0.5
<br /> <b>Warning</b>: Entity: line 12: parser error : expected '>' in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: </images> in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: ^ in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: Entity: line 13: parser error : Opening and ending tag mismatch: image line 3 and Property in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: Entity: line 13: parser error : Premature end of data in tag images line 2 in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: Entity: line 13: parser error : Premature end of data in tag Property line 1 in <b>/in/GBDZ2</b> on line <b>18</b><br /> <br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/in/GBDZ2</b> on line <b>22</b><br />
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/GBDZ2</b> on line <b>18</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.1, 4.4.3 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/GBDZ2</b> on line <b>18</b><br />
Process exited with code 255.
Output for 4.4.2
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/GBDZ2</b> on line <b>19</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/in/GBDZ2</b> on line <b>18</b><br />