3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GeneratePassword($length, $chars) { $str = ''; for($i = 0; $i < $length; $i++) { $str .= $chars[rand(0, strlen($chars) - 1)]; } return $str; } var_dump(GeneratePassword(5, 'abcdefghijklmno'));

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.3.10.0060.00616.69
7.3.00.0100.00416.64
7.2.130.0030.00716.88
7.2.120.0090.00316.74
7.2.110.0000.01116.91
7.2.100.0000.01116.94
7.2.90.0030.00816.87
7.2.80.0130.00317.07
7.2.70.0090.00616.84
7.2.60.0100.00317.13
7.2.50.0040.00716.89
7.2.40.0000.01316.82
7.2.30.0070.00316.90
7.2.20.0000.01016.89
7.2.10.0070.00716.61
7.2.00.0020.01018.16
7.1.250.0040.00715.79
7.1.70.0040.00417.09
7.1.60.0030.01719.40
7.1.50.0210.01434.74
7.1.00.0070.06722.45
7.0.200.0170.00714.55
7.0.140.0130.06722.01
7.0.120.0000.06322.18
7.0.60.0000.07319.95
7.0.50.0200.06017.86
7.0.40.0100.08320.11
7.0.30.0170.05720.25
7.0.20.0300.07020.22
7.0.10.0470.07020.25
7.0.00.0030.07320.06
5.6.280.0000.07320.91
5.6.210.0100.07720.51
5.6.200.0070.06718.25
5.6.190.0100.08720.55
5.6.180.4130.04020.48
5.6.170.0070.05320.47
5.6.160.0100.08020.46
5.6.150.0030.04018.18
5.6.140.0030.07018.24
5.6.130.0030.08018.28
5.6.120.0130.07321.12
5.6.110.0100.06721.12
5.6.100.0170.07321.01
5.6.90.0100.08021.01
5.6.80.0030.03720.51
5.6.70.4070.03720.52
5.5.350.0330.06320.40
5.5.340.0130.07717.98
5.5.330.0030.08720.40
5.5.320.0330.08020.27
5.5.310.0230.05720.34
5.5.300.0070.05717.98
5.5.290.0170.06318.01
5.5.280.0170.06720.77
5.5.270.0070.03720.86
5.5.260.0100.08720.64
5.5.250.0100.08020.54
5.5.240.0230.06720.16
5.4.450.0130.04719.57
5.4.440.0000.05019.30
5.4.430.0100.06319.17
5.4.420.0100.07319.17
5.4.410.0030.04019.31
5.4.400.0030.08019.09
5.4.390.0170.04318.98
5.4.380.0070.08019.16
5.4.370.0030.07319.18
5.4.360.0000.04318.88
5.4.350.0030.08018.92
5.4.340.0000.05018.88
5.4.320.0070.07718.97
5.4.310.0100.06318.85
5.4.300.0070.08319.07
5.4.290.0070.07719.07
5.4.280.0030.06719.12
5.4.270.0000.04719.24
5.4.260.0070.05018.87
5.4.250.0130.05319.07
5.4.240.0100.06719.20
5.4.230.0030.05018.91
5.4.220.0070.07719.09
5.4.210.0100.07318.95
5.4.200.0070.06319.23
5.4.190.0030.07019.07
5.4.180.0070.07319.23
5.4.170.0130.07319.07
5.4.160.0030.04718.83
5.4.150.0130.04718.85
5.4.140.0070.07016.44
5.4.130.0030.07016.40
5.4.120.0130.03316.35
5.4.110.0070.07716.39
5.4.100.0070.07316.41
5.4.90.0230.03316.67
5.4.80.0000.04316.52
5.4.70.0170.06716.39
5.4.60.0030.07716.28
5.4.50.0070.07716.46
5.4.40.0070.06316.42
5.4.30.0070.03716.50
5.4.20.0030.04016.34
5.4.10.0070.03316.39
5.4.00.0000.03715.84
5.3.290.0070.07314.65
5.3.280.0130.05714.75
5.3.270.0070.07714.63
5.3.260.0100.07014.63
5.3.250.0130.06714.60
5.3.240.0000.08014.63
5.3.230.0070.06314.63
5.3.220.0100.04314.49
5.3.210.0100.07314.71
5.3.200.0070.07014.73
5.3.190.0000.08714.56
5.3.180.0100.07314.63
5.3.170.0000.08314.63
5.3.160.0000.08014.63
5.3.150.0070.07314.59
5.3.140.0070.07314.54
5.3.130.0000.04714.60
5.3.120.0100.03014.59
5.3.110.0070.03314.69
5.3.100.0030.03714.05
5.3.90.0000.03714.03
5.3.80.0000.04013.94
5.3.70.0070.03314.06
5.3.60.0100.03714.00
5.3.50.0030.03713.87
5.3.40.0070.04014.09
5.3.30.0030.04013.98
5.3.20.0000.04313.84
5.3.10.0030.03313.71
5.3.00.0000.03713.70
5.2.170.0000.03011.14
5.2.160.0000.03311.29
5.2.150.0000.03311.21
5.2.140.0030.03711.10
5.2.130.0030.05311.02
5.2.120.0000.03011.14
5.2.110.0000.03011.17
5.2.100.0030.02711.17
5.2.90.0000.03711.10
5.2.80.0000.03011.05
5.2.70.0070.02311.16
5.2.60.0070.02311.11
5.2.50.0000.03011.06
5.2.40.0030.02710.91
5.2.30.0000.03311.00
5.2.20.0000.03011.00
5.2.10.0000.03010.78
5.2.00.0030.03310.60
5.1.60.0130.01710.04
5.1.50.0030.02310.04
5.1.40.0000.0239.95
5.1.30.0030.03310.34
5.1.20.0070.02310.41
5.1.10.0030.02310.06
5.1.00.0000.02710.07
5.0.50.0000.0208.54
5.0.40.0000.0208.43
5.0.30.0000.0308.30
5.0.20.0030.0178.26
5.0.10.0030.0178.16
5.0.00.0000.0578.07
4.4.90.0030.0137.80
4.4.80.0000.0137.80
4.4.70.0000.0177.80
4.4.60.0030.0137.80
4.4.50.0030.0137.80
4.4.40.0000.0237.80
4.4.30.0030.0137.80
4.4.20.0000.0177.80
4.4.10.0000.0177.80
4.4.00.0000.0277.80
4.3.110.0030.0107.80
4.3.100.0000.0137.80
4.3.90.0000.0177.80
4.3.80.0000.0477.80
4.3.70.0000.0237.80
4.3.60.0030.0377.80
4.3.50.0000.0407.80
4.3.40.0030.0407.80
4.3.30.0000.0337.80
4.3.20.0030.0377.80
4.3.10.0030.0377.80
4.3.00.0070.0237.80

preferences:
34.64 ms | 401 KiB | 5 Q