3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = "<root> <alfa> <one> <two> </alfa> <beta> <bhi> <bho> </beta> </root>"; $xml = simplexml_load_string($xml); foreach( $xml->children() as $child) { echo $child; }
Output for 7.0.0 - 7.1.0
Warning: simplexml_load_string(): Entity: line 5: parser error : Opening and ending tag mismatch: two line 4 and alfa in /in/1U7mp on line 13 Warning: simplexml_load_string(): </alfa> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/1U7mp on line 13 Warning: simplexml_load_string(): </beta> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Fatal error: Uncaught Error: Call to a member function children() on boolean in /in/1U7mp:15 Stack trace: #0 {main} thrown in /in/1U7mp on line 15
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function children() on a non-object (boolean)' in /in/1U7mp:15 Stack trace: #0 {main} Entity: line 5: parser error : Opening and ending tag mismatch: two line 4 and alfa </alfa> ^ Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta </beta> ^ Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root </root> ^ Entity: line 10: parser error : Premature end of data in tag beta line 6 </root> ^ Entity: line 10: parser error : Premature end of data in tag one line 3 </root> ^ Entity: line 10: parser error : Premature end of data in tag alfa line 2 </root> ^ Entity: line 10: parser error : Premature end of data in tag root line 1 </root> ^
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Warning: simplexml_load_string(): Entity: line 5: parser error : Opening and ending tag mismatch: two line 4 and alfa in /in/1U7mp on line 13 Warning: simplexml_load_string(): </alfa> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/1U7mp on line 13 Warning: simplexml_load_string(): </beta> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Fatal error: Call to a member function children() on boolean in /in/1U7mp on line 15
Process exited with code 255.
Output for 5.1.0 - 5.5.37
Warning: simplexml_load_string(): Entity: line 5: parser error : Opening and ending tag mismatch: two line 4 and alfa in /in/1U7mp on line 13 Warning: simplexml_load_string(): </alfa> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/1U7mp on line 13 Warning: simplexml_load_string(): </beta> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/1U7mp on line 13 Warning: simplexml_load_string(): </root> in /in/1U7mp on line 13 Warning: simplexml_load_string(): ^ in /in/1U7mp on line 13 Fatal error: Call to a member function children() on a non-object in /in/1U7mp on line 15
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: Entity: line 5: parser error : Opening and ending tag mismatch: two line 4 and alfa in /in/1U7mp on line 13 Warning: </alfa> in /in/1U7mp on line 13 Warning: ^ in /in/1U7mp on line 13 Warning: Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/1U7mp on line 13 Warning: </beta> in /in/1U7mp on line 13 Warning: ^ in /in/1U7mp on line 13 Warning: Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/1U7mp on line 13 Warning: </root> in /in/1U7mp on line 13 Warning: ^ in /in/1U7mp on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/1U7mp on line 13 Warning: </root> in /in/1U7mp on line 13 Warning: ^ in /in/1U7mp on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/1U7mp on line 13 Warning: </root> in /in/1U7mp on line 13 Warning: ^ in /in/1U7mp on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/1U7mp on line 13 Warning: </root> in /in/1U7mp on line 13 Warning: ^ in /in/1U7mp on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/1U7mp on line 13 Warning: </root> in /in/1U7mp on line 13 Warning: ^ in /in/1U7mp on line 13 Fatal error: Call to a member function children() on a non-object in /in/1U7mp on line 15
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_string() in /in/1U7mp on line 13
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_string() in /in/1U7mp on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_string() in /in/1U7mp on line 13