3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateSecretKey() { $secret_key_length_min = 8; $secret_key_length_max = 12; $chars = array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9')); shuffle($chars); $chars = sha1(implode('', $chars) . 23); return substr($chars, mt_rand(0, strlen($chars) - $secret_key_length_max), mt_rand($secret_key_length_min, $secret_key_length_max)); } echo generateSecretKey();

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)
7.4.00.0060.01214.62
7.3.120.0100.01014.55
7.3.110.0120.00414.55
7.3.100.0000.01314.82
7.3.90.0070.01114.81
7.3.80.0090.00614.70
7.3.70.0090.00014.74
7.3.60.0040.01214.55
7.3.50.0090.00614.79
7.3.40.0000.01014.88
7.3.30.0000.01514.66
7.3.20.0100.00316.57
7.3.10.0060.00816.51
7.3.00.0050.01016.50
7.2.250.0060.00615.17
7.2.240.0040.01515.17
7.2.230.0050.00514.57
7.2.220.0140.00014.62
7.2.210.0060.01215.09
7.2.200.0070.00714.93
7.2.190.0060.00914.80
7.2.180.0040.00714.98
7.2.170.0070.01014.80
7.2.130.0030.00916.56
7.2.120.0000.01116.72
7.2.110.0080.00516.64
7.2.100.0060.00616.40
7.2.90.0030.01016.74
7.2.80.0090.00316.54
7.2.70.0000.01116.37
7.2.60.0090.00916.61
7.2.50.0040.00816.73
7.2.40.0140.00216.47
7.2.30.0110.00016.40
7.2.20.0050.00516.55
7.2.10.0080.01216.63
7.2.00.0160.00218.11
7.1.330.0070.00715.78
7.1.320.0030.01415.87
7.1.310.0060.00915.67
7.1.300.0000.01615.72
7.1.290.0000.00915.46
7.1.280.0030.01015.54
7.1.270.0110.00315.81
7.1.260.0070.00715.51
7.1.250.0050.00915.64
7.1.70.0040.00717.16
7.1.60.0140.01019.25
7.1.50.0100.01316.91
7.1.00.0030.03322.45
7.0.200.0020.00516.80
7.0.140.0070.07022.07
7.0.120.0030.09321.96
7.0.110.0000.04721.96
7.0.100.0030.04321.97
7.0.90.0030.06722.09
7.0.80.0130.02722.08
7.0.70.0000.04722.05
7.0.60.0030.05722.09
7.0.50.0070.04721.98
7.0.40.0000.04019.96
7.0.30.0100.06019.93
7.0.20.0030.04319.90
7.0.10.0030.03319.99
7.0.00.0100.05719.98
5.6.280.0030.07321.12
5.6.270.0030.06021.01
5.6.260.0130.06021.01
5.6.250.0070.07721.00
5.6.240.0030.08021.04
5.6.230.0000.07720.98
5.6.220.0030.07720.86
5.6.210.0100.06320.89
5.6.200.0030.04020.88
5.6.190.0030.04020.83
5.6.180.0070.07021.00
5.6.170.0030.05020.98
5.6.160.0000.04020.69
5.6.150.0030.04020.75
5.6.140.0000.04320.72
5.6.130.0070.05020.75
5.6.120.0000.04720.95
5.6.110.0030.06720.99
5.6.100.0100.07321.01
5.6.90.0030.04720.85
5.6.80.0000.04020.17
5.6.70.0000.05320.16
5.6.60.0000.07020.39
5.6.50.0030.07720.38
5.6.40.0000.03720.30
5.6.30.0000.06720.36
5.6.20.0030.05320.04
5.6.10.0000.05320.31
5.6.00.0000.04020.06
5.5.380.0030.07717.60
5.5.370.0000.08317.59
5.5.360.0100.06717.58
5.5.350.0000.07717.55
5.5.340.0000.05017.93
5.5.330.0000.04717.87
5.5.320.0070.05017.93
5.5.310.0000.06017.91
5.5.300.0000.07317.95
5.5.290.0000.04317.91
5.5.280.0070.08318.10
5.5.270.0030.03318.22
5.5.260.0100.05318.13
5.5.250.0070.03717.94
5.5.240.0030.07317.49
5.5.230.0000.07717.51
5.5.220.0030.05717.34
5.5.210.0000.04017.51
5.5.200.0000.08717.19
5.5.190.0030.07317.28
5.5.180.0000.07017.57
5.5.160.0000.07017.40
5.5.150.0030.05317.26
5.5.140.0000.06317.48
5.5.130.0100.03017.48
5.5.120.0030.07317.48
5.5.110.0070.07017.48
5.5.100.0000.04717.39
5.5.90.0000.05717.47
5.5.80.0070.06017.20
5.5.70.0030.07317.34
5.5.60.0000.07317.43
5.5.50.0070.06317.16
5.5.40.0030.07717.38
5.5.30.0000.06017.49
5.5.20.0070.03717.38
5.5.10.0000.03717.34
5.5.00.0030.06017.45
5.4.450.0100.06719.27
5.4.440.0070.03719.30
5.4.430.0030.03319.51
5.4.420.0070.03319.27
5.4.410.0030.03719.38
5.4.400.0070.03719.27
5.4.390.0000.04018.89
5.4.380.0030.07318.98
5.4.370.0000.05719.09
5.4.360.0000.04019.04
5.4.350.0000.06718.96
5.4.340.0070.04019.17
5.4.320.0000.08318.91
5.4.310.0000.07719.26
5.4.300.0070.06318.96
5.4.290.0030.06318.97
5.4.280.0000.07718.96
5.4.270.0000.07319.04
5.4.260.0030.07018.96
5.4.250.0000.07718.95
5.4.240.0070.06318.93
5.4.230.0000.06319.29
5.4.220.0030.06318.89
5.4.210.0030.06719.10
5.4.200.0100.06318.95
5.4.190.0030.07718.89
5.4.180.0000.03719.08
5.4.170.0070.07019.18
5.4.160.0070.07318.96
5.4.150.0030.07019.11
5.4.140.0000.05316.30
5.4.130.0000.05016.49
5.4.120.0000.08016.48
5.4.110.0030.04316.54
5.4.100.0000.07016.21
5.4.90.0070.06016.46
5.4.80.0030.05716.37
5.4.70.0000.06316.49
5.4.60.0030.07016.36
5.4.50.0000.07716.35
5.4.40.0000.06316.54
5.4.30.0030.06716.42
5.4.20.0030.05716.34
5.4.10.0000.06016.18
5.4.00.0000.06715.94
5.3.290.0070.07314.68
5.3.280.0030.05714.61
5.3.270.0030.07014.74
5.3.260.0030.07014.57
5.3.250.0100.05314.74
5.3.240.0030.07314.74
5.3.230.0030.06714.62
5.3.220.0030.06314.71
5.3.210.0000.06714.43
5.3.200.0030.06014.71
5.3.190.0030.07314.66
5.3.180.0030.06314.60
5.3.170.0000.06314.57
5.3.160.0030.06314.56
5.3.150.0070.07714.53
5.3.140.0100.05314.55
5.3.130.0070.05714.58
5.3.120.0000.07314.56
5.3.110.0030.09714.56
5.3.100.0030.07314.08
5.3.90.0070.06314.00
5.3.80.0000.07314.03
5.3.70.0000.05713.98
5.3.60.0000.07314.01
5.3.50.0070.07013.81
5.3.40.0000.05314.02
5.3.30.0030.04313.87
5.3.20.0000.06713.78
5.3.10.0030.03713.80
5.3.00.0000.04013.50
5.2.170.0030.08011.14
5.2.160.0000.05711.29
5.2.150.0030.03011.28
5.2.140.0000.05011.16
5.2.130.0030.03011.06
5.2.120.0000.04311.16
5.2.110.0030.05311.08
5.2.100.0000.03011.12
5.2.90.0000.03711.23
5.2.80.0000.05311.24
5.2.70.0030.03311.06
5.2.60.0000.03011.02
5.2.50.0030.04311.02
5.2.40.0000.02711.13
5.2.30.0000.05011.00
5.2.20.0030.05310.97
5.2.10.0000.02711.00
5.2.00.0000.05010.80
5.1.60.0000.05310.25
5.1.50.0000.03710.02
5.1.40.0000.0379.95
5.1.30.0070.04710.32
5.1.20.0000.04310.32
5.1.10.0000.02710.04
5.1.00.0000.02710.16
5.0.50.0000.0279.94
5.0.40.0030.0379.94
5.0.30.0000.0609.94
5.0.20.0000.0309.94
5.0.10.0030.0279.94
5.0.00.0030.0609.94
4.4.90.0000.0179.94
4.4.80.0030.0139.94
4.4.70.0000.0339.94
4.4.60.0000.0209.94
4.4.50.0000.0139.94
4.4.40.0000.0479.94
4.4.30.0030.0309.94
4.4.20.0030.0109.94
4.4.10.0030.0179.94
4.4.00.0030.0509.94
4.3.110.0030.0379.94
4.3.100.0000.0339.94
4.3.90.0030.0239.94
4.3.80.0000.0239.94
4.3.70.0000.0209.94
4.3.60.0000.0279.94
4.3.50.0000.0339.94
4.3.40.0100.0439.94
4.3.30.0030.0109.94
4.3.20.0030.0339.94
4.3.10.0000.0209.94
4.3.00.0000.0179.94

preferences:
39.54 ms | 401 KiB | 5 Q