3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<table border="1"> <tr> <th>Marca</th> <th>Modelo</th> </tr> <?php libxml_use_internal_errors(true); $html = new DOMDocument(); $url = "http://pt.bca-europe.com/SearchVehicle/SearchVehicleResults/?searchToken=null&currentPage=1&pageSize=200&sortOrder=TimeRemaining&saleId=00000000-0000-0000-0000-000000000000&saleCal=False&levelOfDetail=Detail&_=1385046541960#"; $html->loadHtmlFile($url); $xpath = new DOMXPath($html); $marcas = $xpath->query("//div[@id='VehicleResults']/div[@class='AspNet-GridView']/table/tbody/tr/td[@class='ConcatenatedField4']/span"); foreach($marcas as $marca) { $make = $xpath->query("./span[@class='Value Make']", $marca)->item(0)->textContent; $model = $xpath->query("./span[@class='Value Model']", $marca)->item(0)->textContent; echo "<tr><td>$make</td><td>$model</td></tr>\n"; } ?> </table>
Output for 5.5.24 - 5.5.31, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.1.0
<table border="1"> <tr> <th>Marca</th> <th>Modelo</th> </tr> Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/bD0kj on line 10 Warning: DOMDocument::loadHTMLFile(http://pt.bca-europe.com/SearchVehicle/SearchVehicleResults/?searchToken=null&currentPage=1&pageSize=200&sortOrder=TimeRemaining&saleId=00000000-0000-0000-0000-000000000000&saleCal=False&levelOfDetail=Detail&_=1385046541960#): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/bD0kj on line 10 </table>
Output for 5.2.6 - 5.4.45, 5.5.32 - 5.5.33, 5.6.18 - 5.6.19, 7.0.4
<table border="1"> <tr> <th>Marca</th> <th>Modelo</th> </tr> Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: System error in /in/bD0kj on line 10 Warning: DOMDocument::loadHTMLFile(http://pt.bca-europe.com/SearchVehicle/SearchVehicleResults/?searchToken=null&currentPage=1&pageSize=200&sortOrder=TimeRemaining&saleId=00000000-0000-0000-0000-000000000000&saleCal=False&levelOfDetail=Detail&_=1385046541960#): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/bD0kj on line 10 </table>
Output for 5.1.0 - 5.2.5
<table border="1"> <tr> <th>Marca</th> <th>Modelo</th> </tr> Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: System error in /in/bD0kj on line 10 Warning: DOMDocument::loadHTMLFile(http://pt.bca-europe.com/SearchVehicle/SearchVehicleResults/?searchToken=null&currentPage=1&pageSize=200&sortOrder=TimeRemaining&saleId=00000000-0000-0000-0000-000000000000&saleCal=False&levelOfDetail=Detail&_=1385046541960#): failed to open stream: Connection refused in /in/bD0kj on line 10 </table>
Output for 5.0.0 - 5.0.5
<table border="1"> <tr> <th>Marca</th> <th>Modelo</th> </tr> Fatal error: Call to undefined function libxml_use_internal_errors() in /in/bD0kj on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/bD0kj on line 14
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/bD0kj on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/bD0kj on line 14
Process exited with code 255.