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->getname(); }
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/e0e8Z on line 13 Warning: simplexml_load_string(): </alfa> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </beta> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Fatal error: Uncaught Error: Call to a member function children() on boolean in /in/e0e8Z:15 Stack trace: #0 {main} thrown in /in/e0e8Z on line 15
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/e0e8Z on line 13 Warning: simplexml_load_string(): </alfa> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </beta> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Fatal error: Call to a member function children() on boolean in /in/e0e8Z 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/e0e8Z on line 13 Warning: simplexml_load_string(): </alfa> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </beta> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Warning: simplexml_load_string(): Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/e0e8Z on line 13 Warning: simplexml_load_string(): </root> in /in/e0e8Z on line 13 Warning: simplexml_load_string(): ^ in /in/e0e8Z on line 13 Fatal error: Call to a member function children() on a non-object in /in/e0e8Z 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/e0e8Z on line 13 Warning: </alfa> in /in/e0e8Z on line 13 Warning: ^ in /in/e0e8Z on line 13 Warning: Entity: line 9: parser error : Opening and ending tag mismatch: bho line 8 and beta in /in/e0e8Z on line 13 Warning: </beta> in /in/e0e8Z on line 13 Warning: ^ in /in/e0e8Z on line 13 Warning: Entity: line 10: parser error : Opening and ending tag mismatch: bhi line 7 and root in /in/e0e8Z on line 13 Warning: </root> in /in/e0e8Z on line 13 Warning: ^ in /in/e0e8Z on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag beta line 6 in /in/e0e8Z on line 13 Warning: </root> in /in/e0e8Z on line 13 Warning: ^ in /in/e0e8Z on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag one line 3 in /in/e0e8Z on line 13 Warning: </root> in /in/e0e8Z on line 13 Warning: ^ in /in/e0e8Z on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag alfa line 2 in /in/e0e8Z on line 13 Warning: </root> in /in/e0e8Z on line 13 Warning: ^ in /in/e0e8Z on line 13 Warning: Entity: line 10: parser error : Premature end of data in tag root line 1 in /in/e0e8Z on line 13 Warning: </root> in /in/e0e8Z on line 13 Warning: ^ in /in/e0e8Z on line 13 Fatal error: Call to a member function children() on a non-object in /in/e0e8Z 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/e0e8Z 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/e0e8Z 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/e0e8Z on line 13