3v4l.org

run code in 300+ PHP versions simultaneously
<?php function randomPassword() { $currentmonth = date('n'); $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ"; $random = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789"; $pass = array(); $alphaLength = strlen($random) - 1; for ($i = 0; $i < 5; $i++) { $n = rand(0, $alphaLength); $pass[] = $random[$n]; } $pass[4] = substr($alphabet, $currentmonth - 1, 1); return implode($pass); } echo randomPassword();

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)
8.3.10.0200.00624.66
8.3.00.0170.01024.66
8.2.140.0200.00724.66
8.2.130.0100.01024.66
8.2.120.0060.01224.66
8.2.110.0130.01023.34
8.2.100.0070.01422.72
8.2.90.0130.00822.74
8.2.80.0130.00922.62
8.2.70.0140.00222.72
8.2.60.0090.00622.70
8.2.50.0110.00522.58
8.2.40.0090.00622.69
8.2.30.0110.00622.69
8.2.20.0090.00722.68
8.2.10.0110.00422.60
8.2.00.0090.00722.71
8.1.270.0030.00624.66
8.1.260.0080.00024.66
8.1.250.0040.00424.66
8.1.240.0070.00922.53
8.1.230.0100.00722.63
8.1.220.0120.00322.59
8.1.210.0060.01223.25
8.1.200.0100.00422.59
8.1.190.0120.00322.43
8.1.180.0120.00222.42
8.1.170.0060.00822.47
8.1.160.0020.00722.59
8.1.150.0060.00922.55
8.1.140.0120.00522.40
8.1.130.0080.01022.53
8.1.120.0110.00622.49
8.1.110.0080.00721.67
8.1.100.0060.00822.53
8.1.90.0050.00722.50
8.1.80.0090.00522.54
8.1.70.0080.00322.72
8.1.60.0090.00622.63
8.1.50.0060.00422.56
8.1.40.0040.00522.66
8.1.30.0100.00820.98
8.1.20.0120.00620.94
8.1.10.0090.00720.90
8.1.00.0130.00320.97
8.0.300.0070.00322.30
8.0.290.0070.00622.31
8.0.280.0140.00522.32
8.0.270.0040.00622.26
8.0.260.0050.00722.23
8.0.250.0030.00622.27
8.0.240.0060.00622.28
8.0.230.0060.01122.46
8.0.220.0020.00922.27
8.0.210.0090.00322.24
8.0.200.0050.01022.21
8.0.190.0080.00522.27
8.0.180.0020.00722.19
8.0.170.0080.00422.17
8.0.160.0130.00420.44
8.0.150.0140.00420.43
8.0.140.0120.00320.42
8.0.130.0130.00420.34
8.0.120.0110.00520.39
8.0.110.0100.00320.50
8.0.100.0030.00819.02
8.0.90.0080.00618.96
8.0.80.0080.00318.99
8.0.70.0080.00318.96
8.0.60.0080.00619.05
8.0.50.0100.00718.94
8.0.30.0110.00419.04
8.0.20.0080.00619.11
8.0.10.0110.00619.15
8.0.00.0080.00619.21
7.4.330.0090.00619.69
7.4.320.0140.00422.07
7.4.300.0230.00422.10
7.4.290.0130.00622.09
7.4.280.0220.00220.28
7.4.270.0150.01020.20
7.4.260.0230.00220.14
7.4.250.0170.00620.26
7.4.240.0220.00620.22
7.4.230.0140.00418.71
7.4.220.0100.00418.80
7.4.210.0110.00318.77
7.4.200.0110.00218.85
7.4.190.0090.00518.84
7.4.180.0100.00818.87
7.4.160.0140.00418.87
7.4.150.0130.00218.68
7.4.140.0090.00518.77
7.4.130.0100.00318.71
7.4.120.0120.00518.67
7.4.110.0120.00318.33
7.4.100.0160.00218.32
7.4.90.0190.00318.38
7.4.80.0150.00418.33
7.4.70.0110.00618.31
7.4.60.0170.00418.35
7.4.50.0150.00618.21
7.4.40.0140.00818.23
7.4.30.0130.01018.39
7.4.20.0170.00618.27
7.4.10.0160.00617.74
7.4.00.0140.00618.05
7.3.330.0180.00520.01
7.3.320.0220.00419.45
7.3.310.0180.00619.45
7.3.300.0140.00418.25
7.3.290.0150.00318.10
7.3.280.0150.00418.22
7.3.270.0110.00618.26
7.3.260.0140.00518.27
7.3.250.0140.00518.29
7.3.240.0170.00518.29
7.3.230.0150.00818.18
7.3.220.0150.00818.30
7.3.210.0160.00418.26
7.3.200.0160.00518.24
7.3.190.0120.00718.26
7.3.180.0120.00718.26
7.3.170.0120.00718.24
7.3.160.0180.00318.21
7.3.150.0150.00418.27
7.3.140.0140.00518.24
7.3.130.0120.00717.67
7.3.120.0110.00717.64
7.3.110.0130.00517.67
7.3.100.0110.00617.63
7.3.90.0120.00517.83
7.3.80.0120.00617.68
7.3.70.0130.00717.74
7.3.60.0130.00417.70
7.3.50.0090.00417.69
7.3.40.0100.00617.74
7.3.30.0110.00617.72
7.3.20.0120.00518.65
7.3.10.0280.00517.90
7.3.00.0340.00617.88
7.2.340.0120.00418.72
7.2.330.0140.00718.30
7.2.320.0140.00518.32
7.2.310.0190.00318.38
7.2.300.0190.00418.34
7.2.290.0170.00618.30
7.2.280.0160.00318.36
7.2.270.0100.00618.31
7.2.260.0120.00417.89
7.2.250.0130.00617.85
7.2.240.0170.00617.79
7.2.230.0120.00817.86
7.2.220.0130.00517.75
7.2.210.0110.00817.84
7.2.200.0160.00417.89
7.2.190.0120.00817.86
7.2.180.0120.00617.85
7.2.170.0130.00817.81
7.2.160.0150.00317.82
7.2.150.0140.00618.78
7.2.140.0140.00418.82
7.2.130.0260.00518.19
7.2.120.0320.00618.13
7.2.110.0260.00718.11
7.2.100.0380.00718.17
7.2.90.0350.00718.18
7.2.80.0260.00818.17
7.2.70.0240.00518.13
7.2.60.0240.00618.12
7.2.50.0280.00518.08
7.2.40.0240.00718.10
7.2.30.0280.00718.15
7.2.20.0260.00518.16
7.2.10.0270.00718.13
7.2.00.0300.00518.23
7.1.330.0100.00417.94
7.1.320.0120.00418.02
7.1.310.0110.00517.95
7.1.300.0110.00617.95
7.1.290.0150.00217.98
7.1.280.0100.00518.03
7.1.270.0110.00417.94
7.1.260.0090.00517.97
7.1.250.0220.00717.12
7.1.240.0100.00417.92
7.1.230.0110.00418.05
7.1.220.0100.00317.94
7.1.210.0090.00517.93
7.1.200.0100.00317.97
7.1.190.0080.00617.93
7.1.180.0110.00517.94
7.1.170.0130.00517.92
7.1.160.0110.00717.91
7.1.150.0120.00617.85
7.1.140.0120.00617.90
7.1.130.0090.00717.96
7.1.120.0100.00517.90
7.1.110.0100.00417.94
7.1.100.0090.00717.96
7.1.90.0110.00517.86
7.1.80.0100.00717.97
7.1.70.0120.00617.84
7.1.60.0130.00417.95
7.1.50.0120.00417.96
7.1.40.0100.00718.04
7.1.30.0070.00717.94
7.1.20.0130.00417.86
7.1.10.0100.00517.92
7.1.00.0090.00517.85

preferences:
32.14 ms | 403 KiB | 5 Q