3v4l.org

run code in 300+ PHP versions simultaneously
<?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.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
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.

preferences:
86.71 ms | 407 KiB | 5 Q