3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = "http://www.example.com"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); $output = curl_exec($curl); curl_close($curl); $DOM = new DOMDocument; $DOM->loadHTML( $output); //get all H1 $items = $DOM->getElementsByTagName('h1'); //display all H1 text for ($i = 0; $i < $items->length; $i++) echo $items->item($i)->nodeValue . "<br/>";
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/maYis:3 Stack trace: #0 {main} thrown in /in/maYis on line 3
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function curl_init() in /in/maYis on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/maYis on line 16
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, expecting ',' or ';' in /in/maYis on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/maYis on line 16
Process exited with code 255.