3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cookie_file = "cookie.txt"; $urlimdbapi='https://gdata.youtube.com/feeds/api/videos?q=Batman trailer&max-results=1&v=2.1&alt=jsonc&format=5'; $imdbapiresult=new CustomCURL($urlimdbapi, $cookie_file); $imdbresult=$imdbapiresult->send(); $imdbs_info=json_decode($imdbresult['content'], true); print_r($imdbs_info); class CustomCURL{ private $fsocket; private $header; private $method; private $postdata; private $cookie_file; public static $responseHeaders; public static $custom_curl; function __construct($url, $cookie_file){ $this->method='GET'; $this->fsocket = curl_init(); $this->setopt(CURLOPT_URL, $url); $this->setopt(CURLOPT_COOKIEFILE, realpath($cookie_file)); $this->setopt(CURLOPT_COOKIEJAR, realpath($cookie_file)); $this->setopt(CURLOPT_TIMEOUT, 0); $this->setopt(CURLOPT_RETURNTRANSFER, 1); $this->setopt(CURLOPT_MAXREDIRS, 10); $this->setopt(CURLOPT_CONNECTTIMEOUT, 30); $this->setopt(CURLOPT_FOLLOWLOCATION, 1); $this->setopt(CURLOPT_AUTOREFERER, 1); $this->setopt(CURLINFO_HEADER_OUT, 1); $this->setopt(CURLOPT_HEADER, 0); $this->setopt(CURLOPT_VERBOSE, 0); $this->setopt(CURLOPT_SSL_VERIFYPEER, 0); $this->setopt(CURLOPT_SSL_VERIFYHOST, 0); self::$responseHeaders=array(); $this->setopt(CURLOPT_HEADERFUNCTION,array('CustomCURL','headerFunction')); $this->cookie_file=$cookie_file; } static function headerFunction($ch, $header){ $vars=explode(':',$header,2); self::$responseHeaders[strtolower(trim($vars[0]))]=isset($vars[1])?trim($vars[1]):''; return strlen($header); } function setopt($opt, $value){ return curl_setopt($this->fsocket, $opt, $value); } function setHeaders($array){ return $this->header = $array; } function setPostData($array, $isMultipart = true){ $this->method='POST'; if($isMultipart){ $this->postdata = $array; }else{ $post=''; foreach($array as $key=>$val){ if(is_array($val)){ foreach($val as $subval){ if($post!=''){ $post.='&'; } $post.=urlencode($key).'='.urlencode($subval); } }else{ if($post!=''){ $post.='&'; } $post.=urlencode($key).'='.urlencode($val); } } $this->postdata = $post; } } function send($forMulti=false){ if(!empty($this->header)){ $this->setopt(CURLOPT_HTTPHEADER, $this->header); } if($this->method=='POST' && !empty($this->postdata)){ $this->setopt(CURLOPT_POST, 1); $this->setopt(CURLOPT_POSTFIELDS, $this->postdata); } if($forMulti){ return $this->fsocket; } $exec = curl_exec($this->fsocket); if(curl_errno($this->fsocket)){ $result['error'] = curl_error($this->fsocket); }else{ $result['post_data'] = $this->postdata; $result['content'] = $exec; $result['info'] = curl_getinfo($this->fsocket); $result['info']['request_headers']=curl_getinfo($this->fsocket, CURLINFO_HEADER_OUT); $result['info']['response_headers']=self::$responseHeaders; } $this->debug($result, $this->cookie_file); return $result; } function debug($result,$cookie){ /* ============================== THIS IS FOR DEBUGGING PURPOSES ============================== Comment return; to trace output */ return; echo '<h1>',$result['info']['url'],'</h1>'; echo '<h2>Content</h2>'; echo '<pre>',htmlspecialchars($result['content']),'</pre>'; echo '<h2>Cookies</h2>'; echo '<pre>',@file_get_contents($cookie),'</pre>'; echo '<h2>Post Data</h2>'; echo '<pre>'; print_r($result['post_data']); echo '</pre>'; echo '<h2>Other Info</h2>'; echo '<pre>'; print_r($result['info']); echo '</pre>'; flush(); usleep(100); } function close(){ curl_close($this->fsocket); $this->header = array(); $this->postdata = array(); } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.70.0060.00917.00
8.3.60.0060.01316.50
8.3.50.0140.00317.53
8.3.40.0120.00618.87
8.3.30.0070.00718.88
8.3.20.0060.00318.90
8.3.10.0080.00018.90
8.3.00.0030.00619.50
8.2.180.0100.00718.41
8.2.170.0040.01122.96
8.2.160.0030.01021.02
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.83
8.2.110.0090.00020.99
8.2.100.0000.01117.91
8.2.90.0040.00419.07
8.2.80.0050.00319.40
8.2.70.0000.00917.63
8.2.60.0030.00917.43
8.2.50.0000.00818.07
8.2.40.0060.00317.97
8.2.30.0000.01018.04
8.2.20.0060.00317.76
8.2.10.0090.00017.82
8.2.00.0070.00017.81
8.1.280.0040.01125.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0090.00022.33
8.1.230.0070.00421.10
8.1.220.0050.00317.74
8.1.210.0040.00418.81
8.1.200.0070.00317.48
8.1.190.0080.00017.40
8.1.180.0040.00418.10
8.1.170.0040.00418.88
8.1.160.0000.00818.92
8.1.150.0000.00718.61
8.1.140.0000.00817.42
8.1.130.0040.00417.81
8.1.120.0000.00817.45
8.1.110.0000.00817.52
8.1.100.0040.00417.37
8.1.90.0050.00217.33
8.1.80.0000.00717.54
8.1.70.0000.00717.40
8.1.60.0040.00417.54
8.1.50.0080.00017.44
8.1.40.0060.00317.59
8.1.30.0040.00417.55
8.1.20.0000.00817.77
8.1.10.0040.00417.62
8.1.00.0050.00317.46
8.0.300.0070.00020.03
8.0.290.0000.00716.75
8.0.280.0040.00418.45
8.0.270.0030.00317.21
8.0.260.0030.00316.83
8.0.250.0040.00416.92
8.0.240.0030.00517.04
8.0.230.0070.00016.92
8.0.220.0030.00316.95
8.0.210.0000.00716.93
8.0.200.0030.00316.91
8.0.190.0060.00317.00
8.0.180.0040.00416.97
8.0.170.0060.00316.94
8.0.160.0000.00817.05
8.0.150.0040.00417.04
8.0.140.0020.00516.98
8.0.130.0000.00713.43
8.0.120.0060.00317.01
8.0.110.0080.00016.97
8.0.100.0040.00416.76
8.0.90.0040.00416.76
8.0.80.0120.00316.89
8.0.70.0030.00616.92
8.0.60.0040.00416.93
8.0.50.0050.00216.91
8.0.30.0140.01117.13
8.0.20.0120.00717.08
8.0.10.0040.00417.03
8.0.00.0100.00916.79
7.4.330.0050.00012.96
7.4.320.0030.00316.56
7.4.300.0060.00316.71
7.4.290.0030.00616.68
7.4.280.0060.00316.62
7.4.270.0070.00016.68
7.4.260.0030.00313.40
7.4.250.0030.00516.58
7.4.240.0040.00416.64
7.4.230.0050.00216.68
7.4.220.0080.01616.70
7.4.210.0080.00916.66
7.4.200.0040.00416.45
7.4.190.0000.00816.66
7.4.160.0080.00816.72
7.4.150.0150.00316.56
7.4.140.0110.01016.62
7.4.130.0130.00316.71
7.4.120.0090.01016.59
7.4.110.0090.00916.66
7.4.100.0100.01016.40
7.4.90.0080.01116.71
7.4.80.0060.01319.39
7.4.70.0100.00716.48
7.4.60.0070.01016.59
7.4.50.0080.00416.57
7.4.40.0070.00716.65
7.4.30.0130.00316.65
7.4.00.0040.01115.20
7.3.330.0030.00313.46
7.3.320.0030.00313.32
7.3.310.0070.00016.57
7.3.300.0000.00716.52
7.3.290.0000.01416.46
7.3.280.0080.00816.44
7.3.270.0070.01016.37
7.3.260.0070.01016.36
7.3.250.0060.01416.59
7.3.240.0100.01316.64
7.3.230.0070.01016.46
7.3.210.0060.00916.50
7.3.200.0100.00716.50
7.3.190.0070.01316.40
7.3.180.0070.01016.48
7.3.170.0140.00316.54
7.3.160.0120.00416.42
7.3.120.0090.00614.77
7.3.110.0130.00314.86
7.3.100.0030.01314.86
7.3.90.0080.00614.89
7.3.80.0070.00314.88
7.3.70.0040.01114.78
7.3.60.0040.00714.55
7.3.50.0080.00814.80
7.3.40.0140.00014.91
7.3.30.0090.00614.88
7.3.20.0070.01016.62
7.3.10.0070.00716.39
7.3.00.0060.00616.36
7.2.330.0120.01116.76
7.2.320.0170.00316.40
7.2.310.0060.02116.45
7.2.300.0130.00616.63
7.2.290.0070.01016.66
7.2.240.0060.00814.89
7.2.230.0030.00715.18
7.2.220.0050.00515.13
7.2.210.0090.00615.02
7.2.200.0090.00014.71
7.2.190.0030.01014.92
7.2.180.0040.01115.01
7.2.170.0080.00815.07
7.2.160.0090.00614.96
7.2.150.0000.01616.71
7.2.140.0100.00316.55
7.2.130.0030.01016.82
7.2.120.0050.00816.75
7.2.110.0070.00816.57
7.2.100.0050.00816.49
7.2.90.0050.00916.60
7.2.80.0020.01116.65
7.2.70.0030.01016.67
7.2.60.0050.00916.87
7.2.50.0020.01216.60
7.2.40.0030.01116.64
7.2.30.0050.00816.92
7.2.20.0060.00716.81
7.2.10.0050.00716.68
7.2.00.0060.00617.60
7.1.330.0030.00915.64
7.1.320.0070.00715.58
7.1.310.0000.01415.69
7.1.300.0030.01015.72
7.1.290.0030.00915.57
7.1.280.0060.00615.46
7.1.270.0100.00315.75
7.1.260.0090.00615.78
7.1.250.0060.00915.48
7.1.240.0100.00715.90
7.1.230.0040.00715.84
7.1.220.0090.00315.77
7.1.210.0040.00415.63
7.1.200.0020.01015.72
7.1.190.0100.00015.80
7.1.180.0000.00915.63
7.1.170.0040.01115.74
7.1.160.0040.00815.52
7.1.150.0090.00315.67
7.1.140.0000.01015.77
7.1.130.0060.00315.81
7.1.120.0070.00315.63
7.1.110.0000.01015.70
7.1.100.0050.00517.02
7.1.90.0090.00415.75
7.1.80.0030.00715.57
7.1.70.0020.01316.48
7.1.60.0100.00917.54
7.1.50.0070.00516.41
7.1.40.0130.00015.41
7.1.30.0110.00315.64
7.1.20.0070.01015.68
7.1.10.0080.00515.81
7.1.00.0390.04219.06
7.0.320.0030.00315.09
7.0.310.0030.00715.21
7.0.300.0090.00015.13
7.0.290.0090.00615.43
7.0.280.0000.01015.39
7.0.270.0060.00315.32
7.0.260.0000.00915.35
7.0.250.0050.00515.55
7.0.240.0060.00315.45
7.0.230.0000.01015.54
7.0.220.0070.00315.34
7.0.210.0100.00015.39
7.0.200.0130.00515.11
7.0.190.0090.00315.36
7.0.180.0100.00715.44
7.0.170.0140.00015.28
7.0.160.0160.00015.61
7.0.150.0090.00415.15
7.0.140.0060.03818.71
7.0.130.0110.00515.23
7.0.120.0060.02218.65
7.0.110.0120.00415.33
7.0.100.0040.02417.81
7.0.90.0120.02517.52
7.0.80.0050.02517.76
7.0.70.0100.01817.63
7.0.60.0030.02717.65
7.0.50.0150.04017.96
7.0.40.0150.04016.79
7.0.30.0090.04116.69
7.0.20.0070.04016.70
7.0.10.0120.04116.85
7.0.00.0100.04316.65
5.6.380.0030.00913.95
5.6.370.0040.00814.24
5.6.360.0040.00414.51
5.6.350.0030.00914.27
5.6.340.0000.01114.30
5.6.330.0000.01014.49
5.6.320.0110.00014.45
5.6.310.0040.00714.72
5.6.300.0120.00314.59
5.6.290.0040.01114.14
5.6.280.0090.04017.76
5.6.270.0090.00614.54
5.6.260.0130.00414.39
5.6.250.0030.02517.52
5.6.240.0080.03217.53
5.6.230.0100.04017.43
5.6.220.0070.04417.48
5.6.210.0120.03817.76
5.6.200.0060.04317.83
5.6.190.0160.02317.76
5.6.180.0190.03417.65
5.6.170.0080.02717.78
5.6.160.0100.04417.88
5.6.150.0140.02317.73
5.6.140.0100.02717.77
5.6.130.0020.03517.79
5.6.120.0060.03217.65
5.6.110.0060.05017.72
5.6.100.0080.02617.81
5.6.90.0110.02217.75
5.6.80.0080.04217.22
5.6.70.0110.04317.23
5.6.60.0120.03817.38
5.6.50.0090.04117.45
5.6.40.0110.04217.34
5.6.30.0110.02317.20
5.6.20.0090.02817.35
5.6.10.0100.02517.38
5.6.00.0120.04117.38
5.5.380.0030.02115.74
5.5.370.0060.02315.94
5.5.360.0080.02315.80
5.5.350.0050.02415.79
5.5.340.0100.01916.16
5.5.330.0060.02616.03
5.5.320.0020.02716.16
5.5.310.0050.04516.04
5.5.300.0050.04815.96
5.5.290.0060.02815.88
5.5.280.0130.03516.01
5.5.270.0100.03215.96
5.5.260.0100.02516.00
5.5.250.0090.02415.85
5.5.240.0050.04615.71
5.5.230.0130.03315.79
5.5.220.0080.04115.67
5.5.210.0040.02815.71
5.5.200.0050.02615.60
5.5.190.0100.03715.77
5.5.180.0110.03315.73
5.5.170.0130.00314.13
5.5.160.0060.02815.69
5.5.150.0150.03715.78
5.5.140.0080.02715.69
5.5.130.0080.02315.65
5.5.120.0070.03915.65
5.5.110.0050.04415.70
5.5.100.0120.03015.62
5.5.90.0070.02315.53
5.5.80.0050.04015.59
5.5.70.0060.04415.66
5.5.60.0100.04215.66
5.5.50.0040.03615.68
5.5.40.0070.04115.61
5.5.30.0100.02015.71
5.5.20.0080.03715.71
5.5.10.0090.01815.52
5.5.00.0050.02215.60
5.4.450.0080.03815.37
5.4.440.0120.03315.18
5.4.430.0030.03015.15
5.4.420.0090.03315.21
5.4.410.0050.03315.28
5.4.400.0070.03715.22
5.4.390.0120.03715.12
5.4.380.0070.03915.15
5.4.370.0050.03815.15
5.4.360.0120.02514.98
5.4.350.0150.03515.13
5.4.340.0040.02515.06
5.4.330.0110.00011.07
5.4.320.0060.03815.13
5.4.310.0070.03215.06
5.4.300.0060.02915.15
5.4.290.0080.03815.09
5.4.280.0070.04115.05
5.4.270.0070.04215.04
5.4.260.0120.03515.11
5.4.250.0060.03815.10
5.4.240.0030.03815.10
5.4.230.0090.04015.12
5.4.220.0120.03715.08
5.4.210.0130.03014.98
5.4.200.0030.04015.20
5.4.190.0090.03715.09
5.4.180.0050.01815.03
5.4.170.0050.03115.07
5.4.160.0140.03315.04
5.4.150.0100.04014.96
5.4.140.0060.02813.77
5.4.130.0080.02313.77
5.4.120.0060.01613.79
5.4.110.0050.03713.89
5.4.100.0130.02513.82
5.4.90.0050.02113.78
5.4.80.0100.03313.72
5.4.70.0060.04313.77
5.4.60.0070.03813.83
5.4.50.0070.04013.72
5.4.40.0030.03313.76
5.4.30.0070.03713.79
5.4.20.0090.03513.70
5.4.10.0100.03313.76
5.4.00.0070.03813.52
5.3.290.0050.03912.89
5.3.280.0050.04212.83
5.3.270.0090.03612.90
5.3.260.0080.03712.90
5.3.250.0070.03812.83
5.3.240.0080.03212.90
5.3.230.0050.03612.84
5.3.220.0120.02312.82
5.3.210.0110.03412.87
5.3.200.0060.01812.87
5.3.190.0050.02212.85
5.3.180.0090.02012.88
5.3.170.0060.02212.81
5.3.160.0090.03712.85
5.3.150.0070.03812.81
5.3.140.0030.02312.85
5.3.130.0000.04312.88
5.3.120.0050.03312.84
5.3.110.0090.03812.80
5.3.100.0040.02112.61
5.3.90.0050.02012.57
5.3.80.0090.03612.57
5.3.70.0070.03212.61
5.3.60.0070.02912.58
5.3.50.0040.03912.50
5.3.40.0050.04312.59
5.3.30.0110.03312.55
5.3.20.0100.03012.44
5.3.10.0090.02612.44
5.3.00.0070.03612.40

preferences:
93.02 ms | 401 KiB | 5 Q