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()->children as $child) { echo $child->attributes(). "\n"; }
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/tp2dX on line 13 Warning: simplexml_load_string(): </alfa> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/tp2dX on line 13 Warning: simplexml_load_string(): </beta> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Fatal error: Uncaught Error: Call to a member function children() on boolean in /in/tp2dX:15 Stack trace: #0 {main} thrown in /in/tp2dX 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/tp2dX: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/tp2dX on line 13 Warning: simplexml_load_string(): </alfa> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/tp2dX on line 13 Warning: simplexml_load_string(): </beta> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Fatal error: Call to a member function children() on boolean in /in/tp2dX on line 15
Process exited with code 255.
Output for 5.1.0 - 5.5.38
Warning: simplexml_load_string(): Entity: line 5: parser error : Opening and ending tag mismatch: two line 4 and alfa in /in/tp2dX on line 13 Warning: simplexml_load_string(): </alfa> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/tp2dX on line 13 Warning: simplexml_load_string(): </beta> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/tp2dX on line 13 Warning: simplexml_load_string(): </root> in /in/tp2dX on line 13 Warning: simplexml_load_string(): ^ in /in/tp2dX on line 13 Fatal error: Call to a member function children() on a non-object in /in/tp2dX 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/tp2dX on line 13 Warning: </alfa> in /in/tp2dX on line 13 Warning: ^ in /in/tp2dX on line 13 Warning: Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/tp2dX on line 13 Warning: </beta> in /in/tp2dX on line 13 Warning: ^ in /in/tp2dX on line 13 Warning: Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/tp2dX on line 13 Warning: </root> in /in/tp2dX on line 13 Warning: ^ in /in/tp2dX on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/tp2dX on line 13 Warning: </root> in /in/tp2dX on line 13 Warning: ^ in /in/tp2dX on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/tp2dX on line 13 Warning: </root> in /in/tp2dX on line 13 Warning: ^ in /in/tp2dX on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/tp2dX on line 13 Warning: </root> in /in/tp2dX on line 13 Warning: ^ in /in/tp2dX on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/tp2dX on line 13 Warning: </root> in /in/tp2dX on line 13 Warning: ^ in /in/tp2dX on line 13 Fatal error: Call to a member function children() on a non-object in /in/tp2dX on line 15
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/tp2dX on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/tp2dX on line 15
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/tp2dX on line 15
Process exited with code 255.