3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random_password(int $min, int $max) { $allowed = array_merge( [33, 60, 62, 94, 95], range(48, 57), range(64, 90), range(97, 122) ); $l = random_int($min, $max); $chars = []; while ($l--) { $bi = random_int(0, count($allowed)-1); $chars[] = chr($allowed[$bi]); } return implode('', $chars); } var_dump(random_password(8, 12));

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.01215.11
7.4.00.0070.01115.05
7.3.130.0110.00714.75
7.3.120.0110.00314.65
7.3.110.0060.00914.79
7.3.100.0000.00915.04
7.3.90.0100.00714.69
7.3.80.0070.00715.09
7.3.70.0090.00614.63
7.3.60.0000.01314.75
7.3.50.0160.00014.54
7.3.40.0000.01114.77
7.3.30.0000.01314.76
7.3.20.0090.00616.71
7.3.10.0070.00716.83
7.3.00.0000.01216.73
7.2.260.0120.00614.97
7.2.250.0090.00914.77
7.2.240.0090.00915.37
7.2.230.0070.00715.13
7.2.220.0090.00915.29
7.2.210.0000.01815.25
7.2.200.0030.01215.00
7.2.190.0040.01115.02
7.2.180.0000.01514.91
7.2.170.0070.01014.88
7.2.160.0070.00714.88
7.2.150.0040.01216.89
7.2.140.0070.00716.94
7.2.130.0080.00816.94
7.2.120.0000.01816.93
7.2.110.0150.00915.74
7.2.100.0120.00815.69
7.2.90.0210.00815.72
7.2.80.0160.00915.95
7.2.70.0130.01215.91
7.2.60.0200.00215.93
7.2.50.0110.01416.04
7.2.40.0500.01116.00
7.2.30.0150.00916.05
7.2.20.0160.00815.93
7.2.10.0160.00415.78
7.2.00.0100.01115.82
7.1.330.0080.00815.74
7.1.320.0100.00715.86
7.1.310.0080.00815.82
7.1.300.0060.00315.84
7.1.290.0110.00415.80
7.1.280.0070.00715.73
7.1.270.0030.00815.92
7.1.260.0070.00715.76
7.1.250.0000.00815.87
7.1.240.0040.00815.79
7.1.230.0190.00614.72
7.1.220.0170.00714.73
7.1.210.0220.00214.99
7.1.200.0150.00615.00
7.1.190.0130.00714.81
7.1.180.0130.00714.93
7.1.170.0080.01114.92
7.1.160.0140.00814.74
7.1.150.0210.00514.80
7.1.140.0120.01014.94
7.1.130.0170.00414.64
7.1.120.0110.01014.67
7.1.110.0200.00314.76
7.1.100.0080.01314.84
7.1.90.0140.00814.88
7.1.80.0100.00914.81
7.1.70.0140.00514.84
7.1.60.0260.01223.89
7.1.50.0350.00923.69
7.1.40.0220.01323.90
7.1.30.0290.00423.73
7.1.20.0260.00523.79
7.1.10.0190.00914.90
7.1.00.0140.00814.96
7.0.330.0000.01015.49
7.0.320.0080.00415.40
7.0.310.0000.00815.17
7.0.300.0030.01015.49
7.0.290.0080.00415.37
7.0.280.0060.00615.20
7.0.270.0140.00015.35
7.0.260.0040.00415.43
7.0.250.0030.00515.56
7.0.240.0000.01215.40
7.0.230.0070.00715.50
7.0.220.0030.01015.37
7.0.210.0040.01115.50
7.0.200.0040.01115.40
7.0.190.0030.00915.61
7.0.180.0060.01015.54
7.0.170.0090.00615.49
7.0.160.0040.01215.45
7.0.150.0070.00715.20
7.0.140.0040.01115.47
7.0.130.0090.00615.29
7.0.120.0060.00615.67
7.0.110.0090.00615.36
7.0.100.0030.01015.54
7.0.90.0070.00715.63
7.0.80.0110.00415.44
7.0.70.0140.00315.48
7.0.60.0130.00015.46
7.0.50.0100.00315.46
7.0.40.0000.01313.65
7.0.30.0030.00813.65
7.0.20.0060.00313.65
7.0.10.0030.01413.65
7.0.00.0030.00913.65
5.6.400.0160.00014.04
5.6.390.0030.01213.79
5.6.380.0070.00914.38
5.6.370.0030.00713.93
5.6.360.0030.01013.93
5.6.350.0070.00714.07
5.6.340.0000.01114.25
5.6.330.0100.00313.80
5.6.320.0080.00314.07
5.6.310.0100.00014.04
5.6.300.0110.00414.03
5.6.290.0000.01414.14
5.6.280.0040.01214.05
5.6.270.0040.01114.24
5.6.260.0000.01514.24
5.6.250.0060.00813.99
5.6.240.0030.00614.18
5.6.230.0100.00614.02
5.6.220.0070.00414.08
5.6.210.0110.00414.00
5.6.200.0080.00413.87
5.6.190.0060.00614.00
5.6.180.0070.01014.09
5.6.170.0030.01314.12
5.6.160.0030.00914.34
5.6.150.0030.01014.34
5.6.140.0030.00914.34
5.6.130.0120.00313.95
5.6.120.0070.01013.92
5.6.110.0030.01314.20
5.6.100.0140.00013.82
5.6.90.0070.00314.20
5.6.80.0100.00014.27
5.6.70.0040.01214.05
5.6.60.0030.01013.91
5.6.50.0060.00913.82
5.6.40.0030.00613.93
5.6.30.0030.01214.13
5.6.20.0040.01114.07
5.6.10.0000.01213.98
5.6.00.0070.00714.04

preferences:
37.67 ms | 401 KiB | 5 Q