3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml_header = "<?xml version='1.0' encoding='utf-8'?><xml/>"; $xml = new SimpleXMLElement($xml_header); $xml->addChild("first_string","this is &lt;mystring&gt;"); $xml->addChild("second_string","this is &lt; mystring&gt;"); $xml->asXML("test.xml"); echo "<pre>" . $xml->first_string . "<br />"; // 'this is ' echo $xml->second_string . "</pre>"; // 'this is < mystring>'
Output for git.master, git.master_jit, rfc.property-hooks
Warning: SimpleXMLElement::asXML(): open_basedir restriction in effect. File(test.xml) is not within the allowed path(s): (/tmp:/in:/etc) in /in/RUVJS on line 7 Warning: SimpleXMLElement::asXML(test.xml): Failed to open stream: Operation not permitted in /in/RUVJS on line 7 <pre>this is <mystring><br />this is < mystring></pre>

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:
63.69 ms | 402 KiB | 8 Q