3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php set_time_limit(20); $query_data = array('track' => 'lo que quieres buscar'); $user = 'username'; // replace with your account $pass = 'password'; // replace with your account $fp = fsockopen("stream.twitter.com", 80, $errno, $errstr, 20); if(!$fp){ print "$errstr ($errno)\n"; } else { $request = "GET /1/statuses/filter.json?" . http_build_query($query_data) . " HTTP/1.1\r\n"; $request .= "Host: stream.twitter.com\r\n"; $request .= "Authorization: Basic " . base64_encode($user . ':' . $pass) . "\r\n\r\n"; //fwrite($fp, $request); while(!feof($fp)){ $json = fgets($fp); echo($json); $data = json_decode($json, true); if($data){ // // Do something with the data! // var_dump($data); } } fclose($fp); }
based on Xa22n
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.2.6
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in /in/aMGGh on line 9 Warning: fsockopen(): unable to connect to stream.twitter.com:80 (php_network_getaddresses: getaddrinfo failed: System error) in /in/aMGGh on line 9 php_network_getaddresses: getaddrinfo failed: System error (0)
Output for hhvm-3.15.4
System error (0)