3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $html = <<<EOF <div id="nav"> <ul id="someID"> <li><a href="/poker/?ca=v"> THIS </a></li> </ul> </div> EOF; function extractNodeValue($query, $xPath, $attribute = null) { $node = $xPath->query("//{$query}")->item(0); if (!$node) { return null; } return $attribute ? $node->getAttribute($attribute) : $node->nodeValue; } $document = new DOMDocument(); $document->loadHTML($html); $xPath = new DOMXpath($document); $name = extractNodeValue("//a[@href="/poker/?ca=v']/text()",$xPath);
Output for 5.3.0 - 5.4.21
Parse error: syntax error, unexpected '?' in /in/lnCQ1 on line 22
Process exited with code 255.