3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hhb_curl_init($custom_options_array = array()) { if(empty($custom_options_array)){ $custom_options_array=array(); //i feel kinda bad about this.. argv[1] of curl_init wants a string(url), or NULL //at least i want to allow NULL aswell :/ } if (!is_array($custom_options_array)) { throw new InvalidArgumentException('$custom_options_array must be an array!'); }; $options_array = array( CURLOPT_AUTOREFERER => true, CURLOPT_BINARYTRANSFER => true, CURLOPT_COOKIESESSION => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_FORBID_REUSE => false, CURLOPT_HTTPGET => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 11, //CURLOPT_REFERER=>'hanshenrik.tk', ); if (!array_key_exists(CURLOPT_COOKIEFILE, $custom_options_array)) { //do this only conditionally because tmpfile() call.. //we want PHP5.3- support -.- //for 5.4, just: $options_array[CURLOPT_COOKIEFILE]=stream_get_meta_data(tmpfile())['uri']; //static arr workaround for https://bugs.php.net/bug.php?id=66014 ... static $curl_cookiefile_filehandle_arr=array(); $curl_filehandle_arr[]=$options_array[CURLOPT_COOKIEFILE] = tmpfile(); $options_array[CURLOPT_COOKIEFILE] =stream_get_meta_data($options_array[CURLOPT_COOKIEFILE]); $options_array[CURLOPT_COOKIEFILE]=$options_array[CURLOPT_COOKIEFILE]['uri']; } //we can't use array_merge() because of how it handles integer-keys, it would/could cause corruption foreach($custom_options_array as $key => $val) { $options_array[$key] = $val; } unset($key, $val, $custom_options_array); $curl = curl_init(); curl_setopt_array($curl, $options_array); return $curl; } for($i=0;$i<9;++$i){ var_dump(hhb_curl_init()); }

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.60.0070.00716.75
8.3.50.0110.01021.92
8.3.40.0140.00318.58
8.3.30.0110.00419.21
8.3.20.0070.00020.15
8.3.10.0040.00423.48
8.3.00.0060.00319.25
8.2.180.0070.01118.32
8.2.170.0120.00319.13
8.2.160.0110.00722.96
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0000.00826.16
8.2.120.0080.00022.08
8.2.110.0060.00322.08
8.2.100.0040.00717.84
8.2.90.0030.00518.04
8.2.80.0030.00617.97
8.2.70.0060.00318.05
8.2.60.0000.00818.03
8.2.50.0050.00318.10
8.2.40.0000.00819.82
8.2.30.0040.00418.16
8.2.20.0030.00617.85
8.2.10.0000.00718.15
8.2.00.0100.00017.82
8.1.280.0070.01425.92
8.1.270.0030.00623.88
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0030.00622.06
8.1.230.0000.01118.99
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0040.00418.55
8.1.160.0040.00421.99
8.1.150.0070.00418.58
8.1.140.0040.00417.52
8.1.130.0070.00017.95
8.1.120.0000.00717.39
8.1.110.0060.00317.42
8.1.100.0000.00817.38
8.1.90.0000.00717.50
8.1.80.0040.00417.37
8.1.70.0030.00317.50
8.1.60.0030.00517.49
8.1.50.0040.00417.44
8.1.40.0080.00017.56
8.1.30.0060.00317.66
8.1.20.0000.00717.59
8.1.10.0060.00317.59
8.1.00.0030.00617.52
8.0.300.0000.00821.90
8.0.290.0040.00416.63
8.0.280.0040.00418.38
8.0.270.0070.00017.27
8.0.260.0030.00317.34
8.0.250.0050.00217.03
8.0.240.0000.00717.01
8.0.230.0000.00716.98
8.0.220.0030.00316.91
8.0.210.0000.00816.96
8.0.200.0030.00316.93
8.0.190.0070.00017.00
8.0.180.0050.00317.00
8.0.170.0000.00817.02
8.0.160.0000.00716.87
8.0.150.0000.00716.82
8.0.140.0070.00016.98
8.0.130.0030.00313.48
8.0.120.0000.00816.92
8.0.110.0000.00717.04
8.0.100.0040.00416.98
8.0.90.0000.00716.93
8.0.80.0090.01517.02
8.0.70.0030.00517.01
8.0.60.0060.00316.88
8.0.50.0050.00316.92
8.0.30.0140.00517.09
8.0.20.0130.00617.40
8.0.10.0040.00417.01
8.0.00.0120.00516.90
7.4.330.0000.00515.00
7.4.320.0080.00016.45
7.4.300.0040.00416.55
7.4.290.0040.00416.62
7.4.280.0030.00616.62
7.4.270.0000.00816.50
7.4.260.0040.00416.45
7.4.250.0040.00416.59
7.4.240.0050.00216.68
7.4.230.0040.00416.66
7.4.220.0060.01316.61
7.4.210.0100.00416.66
7.4.200.0050.00216.70
7.4.190.0050.00216.77
7.4.160.0130.00316.45
7.4.150.0190.00317.40
7.4.140.0050.01217.86
7.4.130.0120.00916.58
7.4.120.0090.01116.57
7.4.110.0030.01416.68
7.4.100.0080.01916.56
7.4.90.0090.00916.59
7.4.80.0130.01319.39
7.4.70.0090.00816.59
7.4.60.0040.01516.57
7.4.50.0030.00516.57
7.4.40.0100.00716.73
7.4.30.0060.01816.59
7.4.00.0050.01015.11
7.3.330.0030.00313.47
7.3.320.0000.00513.32
7.3.310.0000.00816.43
7.3.300.0030.00316.43
7.3.290.0060.00816.44
7.3.280.0080.00916.43
7.3.270.0070.01417.40
7.3.260.0000.01716.70
7.3.250.0120.01316.48
7.3.240.0090.00916.52
7.3.230.0100.00716.55
7.3.210.0110.00716.59
7.3.200.0070.01019.39
7.3.190.0080.01216.55
7.3.180.0120.00216.47
7.3.170.0000.01716.55
7.3.160.0100.01016.56
7.3.120.0060.01114.82
7.3.110.0110.00714.93
7.3.100.0040.00814.73
7.3.90.0000.01414.84
7.3.80.0070.00714.70
7.3.70.0100.00714.70
7.3.60.0070.01114.76
7.3.50.0060.00614.81
7.3.40.0070.00714.91
7.3.30.0070.01014.90
7.3.20.0120.00316.50
7.3.10.0020.01216.85
7.3.00.0050.00716.72
7.2.330.0060.01216.85
7.2.320.0140.00616.68
7.2.310.0030.01516.68
7.2.300.0130.00316.80
7.2.290.0190.00516.89
7.2.250.0080.01115.36
7.2.240.0030.01715.39
7.2.230.0090.00315.03
7.2.220.0000.01815.42
7.2.210.0060.00915.15
7.2.200.0070.01015.12
7.2.190.0040.00715.27
7.2.180.0050.00514.93
7.2.170.0000.01015.12
7.2.130.0120.00316.96
7.2.120.0060.00617.05
7.2.110.0090.00016.60
7.2.100.0040.00816.91
7.2.90.0060.00617.12
7.2.80.0060.00616.94
7.2.70.0060.00616.95
7.2.60.0050.00617.02
7.2.50.0030.00716.86
7.2.40.0030.00917.07
7.2.30.0030.00916.98
7.2.20.0060.00317.01
7.2.10.0040.00816.75
7.2.00.0060.00618.10
7.1.330.0070.00715.88
7.1.320.0030.01416.09
7.1.310.0030.01015.78
7.1.300.0080.00315.83
7.1.290.0060.00615.68
7.1.280.0100.00315.84
7.1.270.0090.00615.51
7.1.260.0070.00715.81
7.1.250.0100.00715.59
7.1.200.0060.00315.88
7.1.100.0070.00418.33
7.1.70.0000.01316.93
7.1.60.0070.01719.46
7.1.50.0090.01216.76
7.1.00.0000.08022.41
7.0.200.0000.00816.77
7.0.140.0030.07722.08
7.0.80.0270.04019.90
7.0.70.0430.03320.00
7.0.60.0130.03019.99
7.0.50.0330.04720.34
7.0.40.0030.05320.10
7.0.30.0100.07320.13
7.0.20.0130.07720.01
7.0.10.0100.08020.13
7.0.00.0000.08720.14
5.6.280.0100.06721.15
5.6.230.0100.08020.52
5.6.220.0000.04720.53
5.6.210.0070.03320.70
5.6.200.0030.03721.13
5.6.190.0130.05021.07
5.6.180.0030.04021.17
5.6.170.0070.06721.06
5.6.160.0200.07021.07
5.6.150.0030.06721.07
5.6.140.0030.08321.01
5.6.130.0130.08021.03
5.6.120.0170.06020.95
5.6.110.0030.08321.02
5.6.100.0100.08020.94
5.6.90.0100.07021.02
5.6.80.0030.08720.42
5.6.70.0170.06020.47
5.6.60.0130.09020.57
5.6.50.0170.06020.55
5.6.40.0130.06720.54
5.6.30.0100.06020.55
5.6.20.0000.07320.44
5.6.10.0100.06320.47
5.6.00.0070.08020.44
5.5.370.0070.04020.41
5.5.360.0100.05020.53
5.5.350.0070.03720.47
5.5.340.0070.05020.75
5.5.330.0000.04320.82
5.5.320.0000.03720.89
5.5.310.0170.06320.88
5.5.300.0100.08020.86
5.5.290.0000.08720.90
5.5.280.0030.07320.82
5.5.270.0270.04320.77
5.5.260.0000.08720.88
5.5.250.0030.05020.71
5.5.240.0070.07720.16
5.5.230.0030.08320.18
5.5.220.0070.07020.26
5.5.210.0070.06320.27
5.5.200.0200.06720.20
5.5.190.0070.08320.27
5.5.180.0100.07320.28
5.5.160.0030.06720.17
5.5.150.0030.08720.11
5.5.140.0130.07720.27
5.5.130.0030.05020.24
5.5.120.0070.06720.21
5.5.110.0100.08020.24
5.5.100.0130.07320.16
5.5.90.0170.07020.08
5.5.80.0100.07320.06
5.5.70.0070.08020.06
5.5.60.0070.08320.03
5.5.50.0030.08020.09
5.5.40.0170.04019.98
5.5.30.0100.07720.06
5.5.20.0130.07020.05
5.5.10.0170.06020.06
5.5.00.0000.08320.07
5.4.450.0070.08719.42
5.4.440.0130.04719.36
5.4.430.0130.04019.41
5.4.420.0100.07019.36
5.4.410.0070.07319.11
5.4.400.0200.06318.89
5.4.390.0000.07019.20
5.4.380.0070.04019.27
5.4.370.0130.07719.12
5.4.360.0070.06319.04
5.4.350.0070.07718.96
5.4.340.0070.07719.05
5.4.320.0170.07318.88
5.4.310.0130.07019.23
5.4.300.0070.06319.02
5.4.290.0070.07718.89
5.4.280.0070.07718.91
5.4.270.0100.06319.04
5.4.260.0070.08019.04
5.4.250.0170.06719.07
5.4.240.0130.07019.12
5.4.230.0130.04319.04
5.4.220.0100.06019.19
5.4.210.0100.07319.08
5.4.200.0070.07018.89
5.4.190.0070.06019.04
5.4.180.0130.05319.10
5.4.170.0000.09019.08
5.4.160.0130.06719.02
5.4.150.0070.07019.02
5.4.140.0100.06316.36
5.4.130.0030.07316.41
5.4.120.0170.04716.32
5.4.110.0070.06316.58
5.4.100.0070.07716.47
5.4.90.0130.07016.36
5.4.80.0100.07316.45
5.4.70.0070.07716.45
5.4.60.0030.05716.52
5.4.50.0100.03016.39
5.4.40.0030.07716.42
5.4.30.0070.07316.40
5.4.20.0030.05316.48
5.4.10.0100.07016.47
5.4.00.0100.06715.87
5.3.290.0000.08014.76
5.3.280.0070.05014.75
5.3.270.0030.05014.66
5.3.260.0070.07714.65
5.3.250.0100.05014.72
5.3.240.0100.07014.63
5.3.230.0030.07714.64
5.3.220.0100.07314.64
5.3.210.0070.07714.53
5.3.200.0100.07714.72
5.3.190.0070.07014.61
5.3.180.0030.08014.56
5.3.170.0100.07314.55
5.3.160.0200.06314.56
5.3.150.0030.05714.60
5.3.140.0070.04314.50
5.3.130.0070.07014.63
5.3.120.0070.07314.64
5.3.110.0100.07014.55
5.3.100.0030.08014.11
5.3.90.0070.07314.00
5.3.80.0000.07314.19
5.3.70.0030.07714.04
5.3.60.0100.07713.95
5.3.50.0000.08014.03
5.3.40.0030.08014.01
5.3.30.0030.07314.02
5.3.20.0030.04713.77
5.3.10.0070.07013.79
5.3.00.0070.07713.67
5.2.170.0070.05311.67
5.2.160.0000.04011.67
5.2.150.0070.05711.67
5.2.140.0030.05311.67
5.2.130.0100.02711.67
5.2.120.0000.03711.67
5.2.110.0030.06011.67
5.2.100.0030.04711.67
5.2.90.0030.06011.67
5.2.80.0000.06311.67
5.2.70.0070.05711.67
5.2.60.0030.06311.67
5.2.50.0070.05711.67
5.2.40.0030.06311.67
5.2.30.0130.05311.67
5.2.20.0100.06011.67
5.2.10.0070.04711.67
5.2.00.0070.05711.67
5.1.60.0000.04711.67
5.1.50.0070.05011.67
5.1.40.0030.05311.67
5.1.30.0030.05711.67
5.1.20.0100.04711.67
5.1.10.0070.05311.67
5.1.00.0100.05011.67
5.0.50.0070.03711.67
5.0.40.0030.04311.67
5.0.30.0030.06311.67
5.0.20.0000.04711.67
5.0.10.0030.04311.67
5.0.00.0070.06011.67
4.4.90.0030.03711.67
4.4.80.0030.03011.67
4.4.70.0000.03711.67
4.4.60.0000.03711.67
4.4.50.0030.03311.67
4.4.40.0030.02711.67
4.4.30.0000.03711.67
4.4.20.0000.03711.67
4.4.10.0030.03011.67
4.4.00.0070.05011.67
4.3.110.0000.03311.67
4.3.100.0030.03311.67
4.3.90.0000.03711.67
4.3.80.0070.04711.67
4.3.70.0000.03711.67
4.3.60.0000.03011.67
4.3.50.0030.03311.67
4.3.40.0070.05011.67
4.3.30.0000.03711.67
4.3.20.0000.04011.67
4.3.10.0030.02711.67
4.3.00.0000.02711.67

preferences:
40.89 ms | 401 KiB | 5 Q