3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument; $doc->loadHTML(" <html> <body> <p><span>This is mytext :)</span></p> <p><span>This is also MyText :)</span></p> <p><span>MyText at the start :)</span></p> <p><span>Not my text :(</span></p> "); $xpath = new DOMXPath($doc); // Allow calling the stripos() function in XPath $xpath->registerNamespace("php", "http://php.net/xpath"); $xpath->registerPHPFunctions("stripos"); // Example: find <span> elements containing "MyText" (case-insensitive) $nodeList = $xpath->query("//span[php:functionString('stripos', ., 'MyText')]"); foreach ($nodeList as $node) { echo $doc->saveXML($node) . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
<span>This is mytext :)</span> <span>This is also MyText :)</span> <span>MyText at the start :)</span>

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:
113.39 ms | 1497 KiB | 4 Q