3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <book> <section> <p>Example text</p> <p>Another text</p> <img href="imagehref"> <p>Textual content</p> </section> </book>'; $xml = simplexml_load_string($xml); foreach($xml->xpath('/section') as $section) { echo 'Got section', "\n"; foreach($section->children() as $node) { echo $node->getName(), "\n"; } }
Output for git.master, git.master_jit
Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/DBfZe on line 13 Warning: simplexml_load_string(): </section> in /in/DBfZe on line 13 Warning: simplexml_load_string(): ^ in /in/DBfZe on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/DBfZe on line 13 Warning: simplexml_load_string(): </book> in /in/DBfZe on line 13 Warning: simplexml_load_string(): ^ in /in/DBfZe on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/DBfZe on line 13 Warning: simplexml_load_string(): </book> in /in/DBfZe on line 13 Warning: simplexml_load_string(): ^ in /in/DBfZe on line 13 Fatal error: Uncaught Error: Call to a member function xpath() on bool in /in/DBfZe:14 Stack trace: #0 {main} thrown in /in/DBfZe on line 14
Process exited with code 255.
Output for rfc.property-hooks
Warning: simplexml_load_string(): Entity: line 8: parser error : Opening and ending tag mismatch: img line 6 and section in /in/DBfZe on line 13 Warning: simplexml_load_string(): </section> in /in/DBfZe on line 13 Warning: simplexml_load_string(): ^ in /in/DBfZe on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Opening and ending tag mismatch: section line 3 and book in /in/DBfZe on line 13 Warning: simplexml_load_string(): </book> in /in/DBfZe on line 13 Warning: simplexml_load_string(): ^ in /in/DBfZe on line 13 Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag book line 2 in /in/DBfZe on line 13 Warning: simplexml_load_string(): </book> in /in/DBfZe on line 13 Warning: simplexml_load_string(): ^ in /in/DBfZe on line 13 Fatal error: Uncaught Error: Call to a member function xpath() on false in /in/DBfZe:14 Stack trace: #0 {main} thrown in /in/DBfZe on line 14
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.77 ms | 402 KiB | 8 Q