3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getStr($string,$start,$end){ $str = explode($start,$string); $str = explode($end,$str[1]); return $str[0]; } $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.getproxylist.com/proxy?country=BR", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", // CURLOPT_POSTFIELDS => array( // "X-Mashape-Key" => "wQocH1wdCVmshfMaA4oY19xst3H1p1qNljIjsnusupjaYacLWe", // "Accept" => "application/json" // ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { //echo $response; } $token = getStr($response, ', "ip": "',', "port":',', "'); echo $token; ?>
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/k73et:9 Stack trace: #0 {main} thrown in /in/k73et on line 9
Process exited with code 255.
Output for hhvm-3.22.0
cURL Error #:Could not resolve host: api.getproxylist.com Notice: Undefined index: 1 in /in/k73et on line -1
Output for hhvm-3.21.3
cURL Error #:Could not resolve host: api.getproxylist.com Notice: Undefined index: 1 in /in/k73et on line 5
Output for hhvm-3.18.5
cURL Error #:Could not resolve host: api.getproxylist.com Notice: Undefined index: 1 in /in/k73et on line 5 Warning: explode() expects parameter 2 to be string, null given in /in/k73et on line 5
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function curl_init() in /in/k73et on line 9
Process exited with code 255.