3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $username = 'selenagomez'; //$_GET['username'] /* # Use the Curl extension to query Google and get back a page of results $url = "http://instagram.myhacks.net/processing_request.php?username=$username"; $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $html = curl_exec($ch); curl_close($ch); $dom = new DOMDocument(); @$dom->loadHTML($html); foreach($dom->getElementsByid('#current-followers-value') as $link) { # Show the <a href> echo $link->first_child()->plaintext; echo "<br />"; } */ $page = "http://instagram.myhacks.net/processing_request.php?username=" . $username; $dom = new DOMDocument(); @$dom->loadHTML($page); $followerslink = $html->getElementById('current-followers-value'); echo $followerslink->item(0)->nodeValue; echo "<br />"; ?>
based on ljkoj
Output for 7.0.5 - 7.2.12
Notice: Undefined variable: html in /in/tkmot on line 35 Fatal error: Uncaught Error: Call to a member function getElementById() on null in /in/tkmot:35 Stack trace: #0 {main} thrown in /in/tkmot on line 35
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Undefined variable: html in /in/tkmot on line 35 Fatal error: Uncaught Error: Call to a member function getElementById() on unknown in /in/tkmot:35 Stack trace: #0 {main} thrown in /in/tkmot on line 35
Process exited with code 255.
Output for hhvm-3.22.0
Notice: Undefined variable: html in /in/tkmot on line -1 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function getElementById() on a non-object (null)' in /in/tkmot:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.4 - 3.21.3
Notice: Undefined variable: html in /in/tkmot on line 35 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function getElementById() on a non-object (null)' in /in/tkmot:35 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.38
Notice: Undefined variable: html in /in/tkmot on line 35 Fatal error: Call to a member function getElementById() on null in /in/tkmot on line 35
Process exited with code 255.