3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate_password($length = 8, $complex=3) { $min = "abcdefghijklmnopqrstuvwxyz"; $num = "0123456789"; $maj = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $symb = "!@#$%^&*()_-=+;:,.?"; $chars = $min; if ($complex >= 2) { $chars .= $num; } if ($complex >= 3) { $chars .= $maj; } if ($complex >= 4) { $chars .= $symb; } $password = substr( str_shuffle( $chars ), 0, $length ); return $password; } echo generate_password(8); ?>

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.0210.00616.45
7.3.00.0180.00916.11
7.2.130.0200.00716.78
7.2.120.0150.01116.56
7.2.110.0160.00316.91
7.2.100.0060.01316.14
7.2.90.0100.00616.31
7.2.80.0100.01316.46
7.2.70.0110.00816.32
7.2.60.0070.01016.48
7.2.50.0180.00416.27
7.2.40.0160.00816.21
7.2.30.0120.00616.25
7.2.20.0200.00016.61
7.2.10.0140.01016.68
7.2.00.0090.00717.89
7.1.250.0230.00415.28
7.1.100.0040.00918.09
7.1.70.0040.00417.09
7.1.60.0030.01119.27
7.1.50.0070.01016.87
7.1.00.0070.07022.44
7.0.200.0050.00216.61
7.0.60.0100.05019.82
7.0.50.0130.05717.91
7.0.40.0130.05320.40
7.0.30.0200.04720.21
7.0.20.0330.08320.10
7.0.10.0100.08720.05
7.0.00.0030.09320.19
5.6.280.0100.04021.10
5.6.210.0130.07320.73
5.6.200.0030.05718.19
5.6.190.0030.05020.42
5.6.180.3100.04020.45
5.6.170.0200.03720.71
5.6.160.0000.06720.54
5.6.150.0100.07318.18
5.6.140.0130.06718.18
5.6.130.0100.08018.20
5.6.120.0170.04321.14
5.6.110.0130.07321.00
5.6.100.0030.04020.88
5.6.90.0070.07321.00
5.6.80.0070.07320.49
5.6.70.3670.03320.28
5.5.350.0130.07020.41
5.5.340.0030.05318.07
5.5.330.0000.04320.27
5.5.320.0270.08320.34
5.5.310.0530.06020.41
5.5.300.0030.08318.09
5.5.290.0070.06717.93
5.5.280.0070.07020.82
5.5.270.0130.04020.96
5.5.260.0030.09720.85
5.5.250.0100.07720.58
5.5.240.0200.04020.16
5.4.450.0870.06719.37
5.4.440.0930.06019.23
5.4.430.1070.04019.25
5.4.420.0730.06319.39
5.4.410.1030.07019.44
5.4.400.0800.06019.28
5.4.390.0930.04719.22
5.4.380.0770.07019.23
5.4.370.0700.06018.85
5.4.360.0930.06019.05
5.4.350.0930.07719.07
5.4.340.0900.05019.28
5.4.320.0900.05719.32
5.4.310.0970.04719.07
5.4.300.0830.05319.21
5.4.290.0930.05319.23
5.4.280.0930.05719.33
5.4.270.1000.04319.04
5.4.260.0800.06018.91
5.4.250.0930.04719.05
5.4.240.0830.05719.22
5.4.230.1100.05019.22
5.4.220.0930.06319.01
5.4.210.0770.05019.27
5.4.200.0970.04318.93
5.4.190.1130.03719.21
5.4.180.0870.04719.06
5.4.170.1070.05718.90
5.4.160.1100.05319.25
5.4.150.0930.05719.23
5.4.140.1000.04716.33
5.4.130.0870.05016.30
5.4.120.0930.05716.34
5.4.110.0830.05316.44
5.4.100.0900.05016.40
5.4.90.0930.05016.46
5.4.80.0870.04716.57
5.4.70.0230.07716.60
5.4.60.0300.05316.43
5.4.50.0000.03316.54
5.4.40.0100.06016.27
5.4.30.0070.03716.52
5.4.20.0230.03716.55

preferences:
32.88 ms | 401 KiB | 5 Q