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; $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; $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();

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.18 ms | 402 KiB | 8 Q