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) . $this->campaign->getId() . 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.10.0080.00915.03
7.4.00.0050.01314.92
7.3.130.0040.01414.79
7.3.120.0060.01014.80
7.3.110.0070.00914.72
7.3.100.0060.00914.73
7.3.90.0060.00814.66
7.3.80.0070.00914.74
7.3.70.0050.00914.72
7.3.60.0050.00914.71
7.3.50.0070.00814.78
7.3.40.0030.01114.67
7.3.30.0060.00714.63
7.3.20.0040.00916.56
7.3.10.0080.00716.60
7.3.00.0080.00616.66
7.2.260.0070.00915.03
7.2.250.0080.01014.86
7.2.240.0070.00814.86
7.2.230.0020.01315.05
7.2.220.0060.01014.99
7.2.210.0070.00614.96
7.2.200.0040.00914.93
7.2.190.0040.01015.06
7.2.180.0070.01015.00
7.2.170.0060.00814.91
7.2.160.0040.01114.92
7.2.150.0090.00616.75
7.2.140.0090.00616.82
7.2.130.0020.01116.79
7.2.120.0070.00716.80
7.2.110.0070.00816.65
7.2.100.0050.01016.86
7.2.90.0070.00716.92
7.2.80.0070.00816.87
7.2.70.0070.00916.83
7.2.60.0020.01116.83
7.2.50.0040.00916.89
7.2.40.0080.00716.88
7.2.30.0040.00716.76
7.2.20.0060.00816.71
7.2.10.0050.01016.81
7.2.00.0050.00917.29
7.1.330.0060.01015.73
7.1.320.0040.00815.78
7.1.310.0040.00815.64
7.1.300.0040.00915.64
7.1.290.0090.00615.71
7.1.280.0030.00915.60
7.1.270.0060.00615.65
7.1.260.0050.00815.72
7.1.250.0060.00715.81
7.1.240.0060.00815.65
7.1.230.0070.00515.70
7.1.220.0020.01015.69
7.1.210.0050.00815.57
7.1.200.0050.01015.67
7.1.190.0070.00715.67
7.1.180.0040.00715.76
7.1.170.0090.00515.71
7.1.160.0050.00915.78
7.1.150.0060.00815.65
7.1.140.0030.00915.75
7.1.130.0040.00815.81
7.1.120.0060.00715.65
7.1.110.0050.00715.75
7.1.100.0030.01015.63
7.1.90.0060.00715.68
7.1.80.0060.00615.74
7.1.70.0040.00815.99
7.1.60.0040.01116.42
7.1.50.0040.00816.05
7.1.40.0070.00615.67
7.1.30.0070.00715.77
7.1.20.0030.00815.70
7.1.10.0050.00715.62
7.1.00.0060.01516.99
7.0.330.0070.00415.17
7.0.320.0080.00515.32
7.0.310.0050.01015.18
7.0.300.0060.00915.34
7.0.290.0030.01015.35
7.0.280.0050.00915.26
7.0.270.0060.00815.36
7.0.260.0070.00515.34
7.0.250.0030.00915.42
7.0.240.0080.00615.30
7.0.230.0050.00615.45
7.0.220.0070.00815.42
7.0.210.0020.01215.33
7.0.200.0050.00715.63
7.0.190.0040.00815.44
7.0.180.0070.00715.39
7.0.170.0070.00415.38
7.0.160.0040.00915.40
7.0.150.0030.00815.33
7.0.140.0040.02116.71
7.0.130.0050.00915.34
7.0.120.0040.00715.40
7.0.110.0040.01015.44
7.0.100.0080.01216.32
7.0.90.0060.01016.24
7.0.80.0060.01616.27
7.0.70.0060.01316.26
7.0.60.0050.01116.41
7.0.50.0040.02416.50
7.0.40.0030.01814.75
7.0.30.0060.01614.84
7.0.20.0060.02414.77
7.0.10.0060.01514.81
7.0.00.0060.01714.72
5.6.400.0080.00514.15
5.6.390.0060.00614.21
5.6.380.0040.01114.14
5.6.370.0080.00714.28
5.6.360.0080.00614.16
5.6.350.0070.00514.30
5.6.340.0050.00914.09
5.6.330.0070.00813.99
5.6.320.0050.00814.31
5.6.310.0030.01114.18
5.6.300.0050.00814.13
5.6.290.0040.01014.42
5.6.280.0060.02015.56
5.6.270.0070.00414.28
5.6.260.0080.00614.16
5.6.250.0050.01615.44
5.6.240.0030.01815.59
5.6.230.0060.01315.48
5.6.220.0040.01415.47
5.6.210.0060.01615.59
5.6.200.0050.02315.61
5.6.190.0060.01415.57
5.6.180.0060.02015.46
5.6.170.0050.02315.55
5.6.160.0060.01415.45
5.6.150.0040.01715.58
5.6.140.0080.02015.57
5.6.130.0060.01715.51
5.6.120.0070.02315.61
5.6.110.0080.01915.67
5.6.100.0060.02315.48
5.6.90.0040.02315.46
5.6.80.0060.02315.38
5.6.70.0050.01915.45
5.6.60.0060.01915.25
5.6.50.0060.02215.42
5.6.40.0090.01215.34
5.6.30.0020.01815.32
5.6.20.0070.01515.36
5.6.10.0050.01815.30
5.6.00.0100.01215.31
5.5.380.0040.01515.32
5.5.370.0050.01215.49
5.5.360.0040.01515.31
5.5.350.0070.02115.31
5.5.340.0060.01315.50
5.5.330.0040.02115.46
5.5.320.0070.01415.47
5.5.310.0070.01115.54
5.5.300.0060.01615.41
5.5.290.0050.02415.58
5.5.280.0030.02515.39
5.5.270.0030.01715.48
5.5.260.0050.02215.42
5.5.250.0100.01215.34
5.5.240.0090.01915.19
5.5.230.0050.02115.21
5.5.220.0060.01515.26
5.5.210.0050.02115.26
5.5.200.0070.01415.25
5.5.190.0030.01615.24
5.5.180.0040.01815.12
5.5.170.0030.01014.12
5.5.160.0080.01915.22
5.5.150.0110.01215.28
5.5.140.0050.01815.30
5.5.130.0070.02215.28
5.5.120.0070.01915.29
5.5.110.0040.01515.28
5.5.100.0070.01915.20
5.5.90.0110.01815.26
5.5.80.0060.02115.26
5.5.70.0080.01915.21
5.5.60.0030.01715.18
5.5.50.0040.01415.17
5.5.40.0060.01415.24
5.5.30.0060.02015.21
5.5.20.0070.02015.20
5.5.10.0070.02015.23
5.5.00.0050.02315.28
5.4.450.0060.02013.30
5.4.440.0070.01713.21
5.4.430.0080.01013.26
5.4.420.0050.01913.36
5.4.410.0030.01813.25
5.4.400.0060.01713.15
5.4.390.0070.01813.18
5.4.380.0070.00913.26
5.4.370.0040.02013.23
5.4.360.0050.01913.24
5.4.350.0050.01313.19
5.4.340.0050.01713.21
5.4.330.0060.00411.83
5.4.320.0050.01813.20
5.4.310.0040.02013.17
5.4.300.0050.01513.26
5.4.290.0050.01913.16
5.4.280.0070.01813.24
5.4.270.0050.01713.13
5.4.260.0050.02013.25
5.4.250.0040.01513.27
5.4.240.0050.01213.11
5.4.230.0060.01313.22
5.4.220.0050.01313.22
5.4.210.0050.01813.22
5.4.200.0040.02013.15
5.4.190.0060.01613.20
5.4.180.0060.01213.10
5.4.170.0050.01913.18
5.4.160.0070.01813.14
5.4.150.0070.01913.15
5.4.140.0040.01112.60
5.4.130.0050.02112.71
5.4.120.0040.01712.63
5.4.110.0040.02112.75
5.4.100.0040.01312.69
5.4.90.0040.01812.63
5.4.80.0040.01812.61
5.4.70.0060.01212.69
5.4.60.0060.01912.73
5.4.50.0050.01112.70
5.4.40.0060.01412.74
5.4.30.0040.01312.72
5.4.20.0050.01912.75
5.4.10.0020.01412.74
5.4.00.0060.01612.52
5.3.290.0050.01212.21
5.3.280.0030.01812.11
5.3.270.0010.01612.11
5.3.260.0050.01812.19
5.3.250.0060.01012.15
5.3.240.0030.01712.04
5.3.230.0030.01612.11
5.3.220.0040.02012.11
5.3.210.0040.01112.09
5.3.200.0030.02112.18
5.3.190.0050.01912.11
5.3.180.0030.01412.22
5.3.170.0020.01512.20
5.3.160.0040.01912.20
5.3.150.0060.01712.24
5.3.140.0030.01512.23
5.3.130.0030.01412.17
5.3.120.0020.01812.21
5.3.110.0050.01212.14
5.3.100.0040.01912.13
5.3.90.0040.01512.08
5.3.80.0040.02111.98
5.3.70.0040.01812.00
5.3.60.0060.01912.04
5.3.50.0030.01411.99
5.3.40.0030.01512.00
5.3.30.0040.01912.03
5.3.20.0040.01811.93
5.3.10.0040.01211.88
5.3.00.0040.01911.79
5.2.170.0030.03711.68
5.2.160.0030.05711.68
5.2.150.0030.05311.68
5.2.140.0070.03311.68
5.2.130.0170.04311.68
5.2.120.0000.04711.68
5.2.110.0030.06311.68
5.2.100.0070.05311.68
5.2.90.0030.06011.68
5.2.80.0030.03711.68
5.2.70.0100.02311.68
5.2.60.0030.05711.68
5.2.50.0070.06011.68
5.2.40.0030.03311.68
5.2.30.0030.04711.68
5.2.20.0070.06011.68
5.2.10.0070.05311.68
5.2.00.0000.06311.68
5.1.60.0070.02711.68
5.1.50.0070.05311.68
5.1.40.0070.05311.68
5.1.30.0030.04311.68
5.1.20.0070.03311.68
5.1.10.0030.05711.68
5.1.00.0000.05711.68
5.0.50.0170.01011.68
5.0.40.0000.02011.68
5.0.30.0030.06011.68
5.0.20.0130.01311.68
5.0.10.0000.02311.68
5.0.00.0070.02711.68
4.4.90.0070.01311.68
4.4.80.0030.02311.68
4.4.70.0070.01711.68
4.4.60.0030.02311.68
4.4.50.0000.03311.68
4.4.40.0070.05011.68
4.4.30.0070.02311.68
4.4.20.0030.03711.68
4.4.10.0000.04011.68
4.4.00.0030.03711.68
4.3.110.0070.03011.68
4.3.100.0030.03311.68
4.3.90.0000.03311.68
4.3.80.0000.04311.68
4.3.70.0030.02011.68
4.3.60.0000.02011.68
4.3.50.0000.02011.68
4.3.40.0000.04011.68
4.3.30.0000.02711.68
4.3.20.0030.02311.68
4.3.10.0000.01711.68
4.3.00.0030.03711.68

preferences:
36.42 ms | 401 KiB | 5 Q