3v4l.org

run code in 300+ PHP versions simultaneously
$xml = <<<XML <?xml version='1.0' encoding='ISO-8859-1'?> <!DOCTYPE markables SYSTEM "markables.dtd"> <markables> <markable id="markable_1" atrib="yes" span="word_1..word_4"> </markable> <markable id="markable_2" atrib="no" span="word_6..word_7"> </markable> <markable id="markable_3" atrib="yes" span="word_10..word_24"> </markable> </markables> XML; <?php $doc = new DOMDocument(); $doc->loadXML($xml); $xp = new DOMXPath($doc); foreach($xp->query('/markables/markable/@atrib[. != "yes"]') as $attrib) { $attrib->nodeValue = 'yes'; } echo $doc->saveXML();
Output for git.master, git.master_jit, rfc.property-hooks
$xml = <<<XML <?xml version='1.0' encoding='ISO-8859-1'?> <!DOCTYPE markables SYSTEM "markables.dtd"> <markables> <markable id="markable_1" atrib="yes" span="word_1..word_4"> </markable> <markable id="markable_2" atrib="no" span="word_6..word_7"> </markable> <markable id="markable_3" atrib="yes" span="word_10..word_24"> </markable> </markables> XML; Warning: Undefined variable $xml in /in/7rSXL on line 14 Deprecated: DOMDocument::loadXML(): Passing null to parameter #1 ($source) of type string is deprecated in /in/7rSXL on line 14 Fatal error: Uncaught ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty in /in/7rSXL:14 Stack trace: #0 /in/7rSXL(14): DOMDocument->loadXML('') #1 {main} thrown in /in/7rSXL 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:
45.19 ms | 402 KiB | 8 Q