3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument('1.0', 'ASCII'); $dom->appendChild($dom->createElement('foo')); $dom->documentElement->appendChild( $dom->createCDATASection( 'Foo &#228; ]]> &auml; bar äöü' ) ); $dom2 = new DOMDocument(); $dom2->substituteEntities = TRUE; $dom2->resolveExternals = TRUE; $dom2->loadXml($dom->saveXml()); $dom2->encoding= 'UTF-8'; $xpath = new DOMXpath($dom2); var_dump( $dom->saveXml(), $xpath->evaluate('string(/foo)') );
Output for git.master, git.master_jit, rfc.property-hooks
string(119) "<?xml version="1.0" encoding="ASCII"?> <foo><![CDATA[Foo &#228; ]]]]><![CDATA[> &auml; bar &#228;&#246;&#252;]]></foo> " string(44) "Foo &#228; ]]> &auml; bar &#228;&#246;&#252;"

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:
42.91 ms | 401 KiB | 8 Q