3v4l.org

run code in 300+ PHP versions simultaneously
<?php function randomPassword() { $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789"; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < 8; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return implode($pass); //turn the array into a string } ?>

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.0130.00315.04
7.3.120.0080.00814.82
7.3.110.0070.01014.63
7.3.100.0030.01014.98
7.3.90.0030.01214.50
7.3.80.0030.01214.98
7.3.70.0070.01114.48
7.3.60.0000.01414.79
7.3.50.0060.00914.43
7.3.40.0090.00914.71
7.3.30.0080.00414.77
7.3.20.0060.00616.50
7.3.10.0000.01416.63
7.3.00.0070.00716.46
7.2.250.0040.01414.81
7.2.240.0100.01014.81
7.2.230.0100.01014.49
7.2.220.0070.01014.74
7.2.210.0100.00314.77
7.2.200.0120.00614.54
7.2.190.0000.01314.84
7.2.180.0070.01014.88
7.2.170.0000.01114.53
7.1.330.0060.01215.48
7.1.320.0070.01115.71
7.1.310.0060.00915.89
7.1.300.0060.00615.65
7.1.290.0090.00615.56
7.1.280.0070.00315.63
7.1.270.0070.00615.26
7.1.260.0060.00615.64
7.1.70.0100.00316.82
7.1.60.0090.01519.50
7.1.50.0070.01416.76
7.1.00.0000.04722.57
7.0.200.0000.01016.34
7.0.140.0070.07021.97
7.0.60.0100.08319.96
7.0.50.0070.05317.91
7.0.40.0030.04720.30
7.0.30.0170.04320.26
7.0.20.0230.07720.30
7.0.10.0230.07020.30
7.0.00.0070.03720.18
5.6.280.0070.07321.10
5.6.210.0000.07320.45
5.6.200.0000.05318.23
5.6.190.0100.06320.62
5.6.180.3330.04320.46
5.6.170.0230.07020.45
5.6.160.0100.07020.52
5.6.150.0030.04018.23
5.6.140.0030.05018.17
5.6.130.0030.04318.17
5.6.120.0030.07320.99
5.6.110.0100.07320.98
5.6.100.0070.08320.98
5.6.90.0100.08720.97
5.6.80.0200.04320.54
5.6.70.0030.05320.38
5.5.350.0130.08320.34
5.5.340.0030.04017.93
5.5.330.0070.04720.46
5.5.320.0230.07020.34
5.5.310.0270.07720.25
5.5.300.0100.03018.02
5.5.290.0030.06318.03
5.5.280.0000.08720.79
5.5.270.0000.04720.96
5.5.260.0070.07320.84
5.5.250.0070.07720.62
5.5.240.0130.07720.07
5.4.450.0900.05719.70
5.4.440.0700.05719.61
5.4.430.0130.06019.19
5.4.420.0800.05719.47
5.4.410.0670.05719.25
5.4.400.1030.06718.87
5.4.390.1070.05718.75
5.4.380.0370.05718.74
5.4.370.0270.04018.46
5.4.360.0130.05018.59
5.4.350.0100.03712.02
5.4.340.0020.04412.02
5.4.320.0050.04012.50
5.4.310.0070.04012.50
5.4.300.0050.03812.50
5.4.290.0050.04612.50
5.4.280.0070.03512.40
5.4.270.0110.04412.40
5.4.260.0040.03912.40
5.4.250.0070.05318.96
5.4.240.0030.05318.96
5.4.230.0100.04718.75
5.4.220.0030.05719.00
5.4.210.0070.07719.09
5.4.200.0070.05318.91
5.4.190.0170.04318.96
5.4.180.0130.04718.65
5.4.170.0130.04718.79
5.4.160.0130.04319.08
5.4.150.0170.05719.00
5.4.140.0100.04716.51
5.4.130.0170.03716.35
5.4.120.0070.05016.52
5.4.110.0000.05716.62
5.4.100.0030.05716.47
5.4.90.0030.05316.50
5.4.80.0170.04016.49
5.4.70.0100.04716.39
5.4.60.0130.05016.53
5.4.50.0070.07016.38
5.4.40.0100.04716.62
5.4.30.0070.04716.41
5.4.20.0170.04016.33
5.4.10.0070.05316.48
5.4.00.0100.04315.96
5.3.290.0050.04412.80
5.3.280.0030.05314.68
5.3.270.0000.06014.69
5.3.260.0130.04714.76
5.3.250.0130.04314.76
5.3.240.0100.04714.59
5.3.230.0000.05714.75
5.3.220.0100.04714.53
5.3.210.0070.05014.72
5.3.200.0100.05714.63
5.3.190.0030.05314.70
5.3.180.0070.05714.64
5.3.170.0070.07014.66
5.3.160.0100.05014.54
5.3.150.0130.06314.69
5.3.140.0200.04714.73
5.3.130.0100.06014.54
5.3.120.0070.08314.37
5.3.110.0070.05314.57
5.3.100.0100.05014.20
5.3.90.0030.05014.03
5.3.80.0070.04714.25
5.3.70.0030.05713.85
5.3.60.0070.05014.18
5.3.50.0130.04013.77
5.3.40.0130.05713.77
5.3.30.0100.05313.89
5.3.20.0130.04313.60
5.3.10.0070.04713.66
5.3.00.0030.05013.46
5.2.170.0000.04711.22
5.2.160.0070.04011.31
5.2.150.0030.04311.20
5.2.140.0070.04011.20
5.2.130.0070.04311.32
5.2.120.0030.04011.16
5.2.110.0100.05011.27
5.2.100.0100.03311.18
5.2.90.0030.04311.08
5.2.80.0100.03711.18
5.2.70.0030.04711.15
5.2.60.0000.04311.06
5.2.50.0030.04011.09
5.2.40.0030.03711.07
5.2.30.0000.04310.96
5.2.20.0030.04010.91
5.2.10.0030.04011.02
5.2.00.0100.03310.80
5.1.60.0100.0309.91
5.1.50.0030.0339.98
5.1.40.0030.0379.93
5.1.30.0000.04010.41
5.1.20.0030.03710.34
5.1.10.0070.03310.16
5.1.00.0070.04310.05
5.0.50.0070.0408.46
5.0.40.0030.0278.57
5.0.30.0070.0378.43
5.0.20.0000.0308.15
5.0.10.0100.0208.17
5.0.00.0030.0408.13
4.4.90.0100.0177.31
4.4.80.0000.0237.31
4.4.70.0070.0277.31
4.4.60.0070.0177.31
4.4.50.0000.0307.31
4.4.40.0000.0377.31
4.4.30.0000.0237.31
4.4.20.0030.0207.31
4.4.10.0070.0177.31
4.4.00.0100.0237.31
4.3.110.0000.0237.31
4.3.100.0000.0207.31
4.3.90.0030.0207.31
4.3.80.0030.0307.31
4.3.70.0000.0207.31
4.3.60.0070.0137.31
4.3.50.0000.0237.31
4.3.40.0000.0337.31
4.3.30.0030.0207.31
4.3.20.0000.0237.31
4.3.10.0000.0277.31
4.3.00.0030.0206.81

preferences:
35.08 ms | 401 KiB | 5 Q