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.0.0 - 7.1.0
Output for 4.4.3 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/hJ935 on line 12
Process exited with code 255.
Output for 4.4.2
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/hJ935 on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/hJ935 on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/hJ935 on line 12
Process exited with code 255.