3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<EOD <td class="useragent"><a href="/useragents/parse/627832-chrome-windows-blink">Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36</a></td> EOD; $domDocument = new DOMDocument; $domDocument->loadHTML($text, LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($domDocument); $nodes = $xpath->query('//td[@class="useragent"]/a'); $res = []; foreach($nodes as $txt) { array_push($res, $txt->textContent); } print_r($res);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 )

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