3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit', '-1'); // http://forrk.co.uk/blog/Finding-a-short-Twitter-Username-Mission-Impossible/1 function checkusername($username){ if(!empty($username) && $username != ''){ $url="http://twitter.com/".$username; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $return = curl_exec($ch); $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if($http_status == '404'){ echo 'Available: '.$username."\n"; } else{ // not available } }// if }// function checkusername($username) // http://stackoverflow.com/a/19067884/901502 function build_usernames($chars, $size, $combinations = array()){ // if it's the first iteration, the first set // of combinations is the same as the set of characters if(empty($combinations)){ $combinations = $chars; } // we're done if we're at size 1 if ($size == 1) { return $combinations; } // initialise array to put new values in $new_combinations = array(); // loop through existing combinations and character set to create strings foreach($combinations as $combination){ foreach($chars as $char){ $new_combinations[] = $combination . $char; }// foreach }// foreach // call same function again for the next iteration return build_usernames($chars, $size - 1, $new_combinations); }// function build_usernames($chars, $size, $combinations = array()) // set the possible chars to build the username from $possible_chars = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm'); // build the user name combinations for up to 4 char usernames $possible_usernames = build_usernames($possible_chars, 4); // loop through all usernames and check each with twitter foreach($possible_usernames as $username){ checkusername($username); }

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.0660.04766.88
8.3.50.0590.05366.78
8.3.40.0200.06045.11
8.3.30.0360.04645.09
8.3.20.0330.02046.66
8.3.10.0300.00748.21
8.3.00.0190.01344.80
8.2.180.0570.05366.64
8.2.170.0330.03045.00
8.2.160.0310.03146.64
8.2.150.0210.01445.17
8.2.140.0070.01448.27
8.2.130.0200.01044.92
8.2.120.0230.01343.90
8.2.110.0030.03448.10
8.2.100.0360.02043.93
8.2.90.0160.02245.61
8.2.80.0160.02043.91
8.2.70.0170.01743.89
8.2.60.0200.01644.27
8.2.50.0160.02644.02
8.2.40.0070.02945.65
8.2.30.0220.01644.46
8.2.20.0130.02043.92
8.2.10.0220.01244.25
8.2.00.0170.01744.35
8.1.270.0140.01439.45
8.1.260.0160.01039.88
8.1.250.0160.01641.45
8.1.240.0030.02440.57
8.1.230.0270.00936.38
8.1.220.0150.00936.73
8.1.210.0070.01836.18
8.1.200.0160.01336.29
8.1.190.0040.02536.16
8.1.180.0100.01736.55
8.1.170.0180.00937.62
8.1.160.0180.00741.02
8.1.150.0100.01437.77
8.1.140.0060.01936.47
8.1.130.0090.01536.71
8.1.120.0130.01036.41
8.1.110.0100.01336.44
8.1.100.0150.01136.47
8.1.90.0070.01736.50
8.1.80.0070.01736.46
8.1.70.0060.01936.40
8.1.60.0030.02636.56
8.1.50.0100.02036.52
8.1.40.0110.01936.58
8.1.30.0170.01336.64
8.1.20.0100.02036.63
8.1.10.0430.04784.56
8.1.00.0390.05284.45
8.0.300.0340.04483.86
8.0.290.0400.03383.66
8.0.280.0480.04885.29
8.0.270.0370.04484.13
8.0.260.0560.03684.16
8.0.250.0440.03783.66
8.0.240.0330.04083.68
8.0.230.0370.04183.88
8.0.220.0370.04483.70
8.0.210.0400.03383.75
8.0.200.0450.02983.88
8.0.190.0400.05683.87
8.0.180.0560.04383.76
8.0.170.0430.05083.66
8.0.160.0240.06283.76
8.0.150.0430.05083.75
8.0.140.0460.04683.75
8.0.130.0430.05380.29
8.0.120.0330.06383.71
8.0.110.0500.04083.57
8.0.100.0330.05683.58
8.0.90.0440.05183.57
8.0.80.0860.08383.75
8.0.70.0300.06083.61
8.0.60.0200.07583.79
8.0.50.0450.04583.68
8.0.30.0890.07483.91
8.0.20.0930.11483.88
8.0.10.0200.06983.80
8.0.00.1270.11383.73
7.4.330.0290.03581.01
7.4.320.0310.04183.43
7.4.300.0300.03983.26
7.4.290.0490.06283.33
7.4.280.0610.06083.43
7.4.270.0520.04283.41
7.4.260.0500.04383.31
7.4.250.0300.06083.28
7.4.240.0300.05583.39
7.4.230.0340.05483.32
7.4.220.1280.07483.33
7.4.210.0940.08683.35
7.4.200.0330.05383.41
7.4.160.1030.07683.25
7.4.150.1140.08783.46
7.4.140.1130.10783.28
7.4.130.0890.11483.34
7.4.120.1050.10383.47
7.4.110.1540.154121.80
7.4.100.1620.165121.80
7.4.90.1760.123121.78
7.4.80.1520.151121.81
7.4.70.1610.138121.77
7.4.60.1300.163122.04
7.4.50.0300.069121.74
7.4.40.1380.190122.00
7.4.30.1580.161121.71
7.4.00.0630.134119.97
7.3.330.0370.06580.28
7.3.320.0390.04580.26
7.3.310.0240.06883.18
7.3.300.0270.05783.16
7.3.290.0370.04783.06
7.3.280.0910.09783.23
7.3.270.1220.07683.11
7.3.260.1050.08683.20
7.3.250.0950.09983.28
7.3.240.0960.08983.20
7.3.230.1730.189121.89
7.3.210.1490.189121.95
7.3.200.1520.155121.64
7.3.190.1370.190121.98
7.3.180.1920.178121.96
7.3.170.1230.166121.87
7.3.160.1520.172121.75
7.2.330.1760.150122.07
7.2.320.1520.188122.20
7.2.310.1580.162122.00
7.2.300.1510.172122.23
7.2.290.1640.161121.75
7.2.60.3750.089122.49
7.2.00.4080.100125.62
7.1.200.3950.093121.70
7.1.100.0470.07177.99
7.1.70.1750.079123.05
7.1.60.0100.149123.51
7.1.50.1240.134122.95
7.1.00.0170.187128.45
7.0.200.7650.107121.55
7.0.60.0470.190125.34
7.0.50.0200.150123.18
7.0.40.0570.14385.27
7.0.30.2170.12385.16
7.0.20.2230.16085.23
7.0.10.0500.16385.05
7.0.00.0370.14385.29
5.6.280.0470.360271.17
5.6.210.1200.350322.56
5.6.200.0870.383320.24
5.6.190.1130.410322.31
5.6.180.7000.323322.49
5.6.170.1100.413322.41
5.6.160.0900.343322.54
5.6.150.0930.377320.27
5.6.140.0870.330320.26
5.6.130.1070.340320.28
5.6.120.1200.307323.21
5.6.110.0630.383323.23
5.6.100.0730.327323.14
5.6.90.0970.390323.21
5.6.80.0830.330322.50
5.6.70.8230.297322.60
5.5.350.0970.380322.59
5.5.340.0830.390320.08
5.5.330.1230.380322.26
5.5.320.1030.423322.33
5.5.310.1030.410322.20
5.5.300.1330.363320.04
5.5.290.0970.307319.98
5.5.280.1030.337322.89
5.5.270.0900.417322.97
5.5.260.0930.423322.78
5.5.250.1170.383322.67
5.5.240.0800.293322.27
5.4.450.3100.593321.68
5.4.440.3970.600321.46
5.4.430.3030.553321.73
5.4.420.3070.507321.46
5.4.410.3530.480321.47
5.4.400.2930.520321.11
5.4.390.3300.467321.10
5.4.380.3230.597320.86
5.4.370.3170.483320.84
5.4.360.3400.457321.10
5.4.350.3270.473320.88
5.4.340.3200.563321.16
5.4.320.3130.490321.16
5.4.310.1600.510321.02
5.4.300.2870.490321.29
5.4.290.3200.493321.30
5.4.280.3300.497321.25
5.4.270.3370.497320.87
5.4.260.3000.547321.08
5.4.250.1800.540321.31
5.4.240.2970.527321.12
5.4.230.3700.520320.99
5.4.220.1930.500320.83
5.4.210.2000.510321.00
5.4.200.2200.513321.16
5.4.190.3100.557321.29
5.4.180.3230.500321.16
5.4.170.3100.493321.15
5.4.160.3070.583321.27
5.4.150.3370.553321.25
5.4.140.3900.593318.57
5.4.130.1870.617318.45
5.4.120.2730.537318.44
5.4.110.2830.540318.69
5.4.100.1700.543318.26
5.4.90.3000.513318.27
5.4.80.2800.517318.69
5.4.70.0970.373318.57
5.4.60.0870.347318.52
5.4.50.0730.393318.62
5.4.40.1170.377318.40
5.4.30.1000.353318.65
5.4.20.1130.390318.33

preferences:
63.18 ms | 400 KiB | 5 Q