3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rawxml = '<?xml version="1.0"?><root><field attr1="val1"><field attr1="val1"/></field></root>'; $rawxpath = "/root[1]/field[@attr1='val1']"; $results = array(); for ($i = 0; $i < 10000; $i++) { $xmlDocument = new DOMDocument(); $xmlDocument->loadXML($rawxml); $xp = new DOMXPath($xmlDocument); $xpr = $xp->evaluate($rawxpath, $xmlDocument->documentElement); if (isset($results[(string) $xpr->length])) $results[(string) $xpr->length]++; else $results[(string) $xpr->length] = 1; } foreach ($results as $matches => $count) printf("In %5d instances, found $matches match(es) for $rawxpath\n", $count);
Output for git.master, git.master_jit, rfc.property-hooks
In 10000 instances, found 1 match(es) for /root[1]/field[@attr1='val1']

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