3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <book> <section> <p>Example text</p> <p>Another text</p> <img l:href="imagehref"> <p>Textual content</p> </section> </book>'; $xml = simplexml_load_string($xml); foreach($node->xpath('/section') as $section) { echo 'Got section', "\n"; }
Output for 7.0.6 - 7.2.0
Warning: simplexml_load_string(): namespace error : Namespace prefix l for href on img is not defined in /in/sbKjF on line 13 Warning: simplexml_load_string(): <img l:href="imagehref"> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/sbKjF on line 13 Warning: simplexml_load_string(): </section> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/sbKjF on line 13 Warning: simplexml_load_string(): </book> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/sbKjF on line 13 Warning: simplexml_load_string(): </book> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Notice: Undefined variable: node in /in/sbKjF on line 14 Fatal error: Uncaught Error: Call to a member function xpath() on null in /in/sbKjF:14 Stack trace: #0 {main} thrown in /in/sbKjF on line 14
Process exited with code 255.
Output for 7.0.5
Warning: simplexml_load_string(): namespace error : Namespace prefix l for href on img is not defined in /in/sbKjF on line 13 Warning: simplexml_load_string(): <img l:href="imagehref"> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/sbKjF on line 13 Warning: simplexml_load_string(): </section> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/sbKjF on line 13 Notice: Undefined variable: node in /in/sbKjF on line 14 Fatal error: Uncaught Error: Call to a member function xpath() on null in /in/sbKjF:14 Stack trace: #0 {main} thrown in /in/sbKjF on line 14
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Warning: simplexml_load_string(): namespace error : Namespace prefix l for href on img is not defined in /in/sbKjF on line 13 Warning: simplexml_load_string(): <img l:href="imagehref"> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/sbKjF on line 13 Warning: simplexml_load_string(): </section> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/sbKjF on line 13 Notice: Undefined variable: node in /in/sbKjF on line 14 Fatal error: Uncaught Error: Call to a member function xpath() on unknown in /in/sbKjF:14 Stack trace: #0 {main} thrown in /in/sbKjF on line 14
Process exited with code 255.
Output for 5.6.8 - 5.6.12, 5.6.21 - 5.6.28
Warning: simplexml_load_string(): namespace error : Namespace prefix l for href on img is not defined in /in/sbKjF on line 13 Warning: simplexml_load_string(): <img l:href="imagehref"> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/sbKjF on line 13 Warning: simplexml_load_string(): </section> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/sbKjF on line 13 Warning: simplexml_load_string(): </book> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/sbKjF on line 13 Warning: simplexml_load_string(): </book> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Notice: Undefined variable: node in /in/sbKjF on line 14 Fatal error: Call to a member function xpath() on null in /in/sbKjF on line 14
Process exited with code 255.
Output for 5.6.13 - 5.6.20
Warning: simplexml_load_string(): namespace error : Namespace prefix l for href on img is not defined in /in/sbKjF on line 13 Warning: simplexml_load_string(): <img l:href="imagehref"> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/sbKjF on line 13 Warning: simplexml_load_string(): </section> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/sbKjF on line 13 Notice: Undefined variable: node in /in/sbKjF on line 14 Fatal error: Call to a member function xpath() on null in /in/sbKjF on line 14
Process exited with code 255.
Output for 5.5.24 - 5.5.28, 5.5.35
Warning: simplexml_load_string(): namespace error : Namespace prefix l for href on img is not defined in /in/sbKjF on line 13 Warning: simplexml_load_string(): <img l:href="imagehref"> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/sbKjF on line 13 Warning: simplexml_load_string(): </section> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/sbKjF on line 13 Warning: simplexml_load_string(): </book> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/sbKjF on line 13 Warning: simplexml_load_string(): </book> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Notice: Undefined variable: node in /in/sbKjF on line 14 Fatal error: Call to a member function xpath() on a non-object in /in/sbKjF on line 14
Process exited with code 255.
Output for 5.3.21 - 5.4.45, 5.5.29 - 5.5.34
Warning: simplexml_load_string(): namespace error : Namespace prefix l for href on img is not defined in /in/sbKjF on line 13 Warning: simplexml_load_string(): <img l:href="imagehref"> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/sbKjF on line 13 Warning: simplexml_load_string(): </section> in /in/sbKjF on line 13 Warning: simplexml_load_string(): ^ in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/sbKjF on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/sbKjF on line 13 Notice: Undefined variable: node in /in/sbKjF on line 14 Fatal error: Call to a member function xpath() on a non-object in /in/sbKjF on line 14
Process exited with code 255.