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) ); $length = random_int($min, $max); $chars = []; for ($i = 0; $i < $length; $i++) { $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.0090.00915.11
7.4.00.0060.01114.71
7.3.130.0130.00615.06
7.3.120.0130.00314.74
7.3.110.0030.01314.84
7.3.100.0140.00014.55
7.3.90.0070.00715.00
7.3.80.0100.00714.89
7.3.70.0090.00014.86
7.3.60.0000.01214.68
7.3.50.0090.00314.88
7.3.40.0040.01214.68
7.3.30.0030.01214.77
7.3.20.0000.01216.79
7.3.10.0030.01216.58
7.3.00.0070.00316.52
7.2.260.0070.01115.06
7.2.250.0000.01814.70
7.2.240.0090.00914.93
7.2.230.0100.00315.26
7.2.220.0060.00915.30
7.2.210.0070.00715.30
7.2.200.0090.00614.99
7.2.190.0030.01215.07
7.2.180.0090.00015.05
7.2.170.0000.01514.99
7.2.160.0040.01114.85
7.2.150.0080.00417.07
7.2.140.0040.01117.07
7.2.130.0040.00817.05
7.2.120.0000.01616.73
7.2.110.1150.00515.77
7.2.100.0120.01015.88
7.2.90.0190.00616.00
7.2.80.0150.01015.67
7.2.70.0150.01115.82
7.2.60.0190.00415.78
7.2.50.0180.00816.04
7.2.40.0310.00416.03
7.2.30.0140.00815.94
7.2.20.0140.01115.88
7.2.10.0130.01115.97
7.2.00.0280.00215.79
7.1.330.0120.00315.64
7.1.320.0030.01015.48
7.1.310.0100.00615.94
7.1.300.0100.00616.01
7.1.290.0020.00815.69
7.1.280.0060.01015.84
7.1.270.0090.00315.74
7.1.260.0080.00815.93
7.1.250.0160.00016.05
7.1.240.0040.00715.82
7.1.230.0120.00815.07
7.1.220.0120.01314.63
7.1.210.0110.01014.93
7.1.200.0160.00714.78
7.1.190.0160.01114.60
7.1.180.0150.00714.75
7.1.170.0190.00514.97
7.1.160.0270.00314.85
7.1.150.0260.00314.70
7.1.140.0180.00514.74
7.1.130.0590.00514.85
7.1.120.0160.01314.67
7.1.110.0150.00914.87
7.1.100.0190.00514.70
7.1.90.0250.00714.86
7.1.80.0250.00514.77
7.1.70.0180.00514.95
7.1.60.0270.01023.86
7.1.50.0290.00323.71
7.1.40.0250.01223.96
7.1.30.0280.00923.76
7.1.20.0400.00923.90
7.1.10.0250.00814.80
7.1.00.0260.00314.75
7.0.330.0090.00315.45
7.0.320.0040.01115.27
7.0.310.0110.00015.10
7.0.300.0030.00815.55
7.0.290.0030.00915.44
7.0.280.0000.01515.43
7.0.270.0000.01315.54
7.0.260.0030.01015.45
7.0.250.0070.00715.31
7.0.240.0040.01115.55
7.0.230.0070.00715.60
7.0.220.0070.00715.50
7.0.210.0070.00315.34
7.0.200.0000.01515.36
7.0.190.0100.00315.25
7.0.180.0080.00315.33
7.0.170.0040.00815.63
7.0.160.0040.00815.13
7.0.150.0030.00615.39
7.0.140.0060.00615.31
7.0.130.0070.00415.36
7.0.120.0030.01015.53
7.0.110.0040.01115.58
7.0.100.0040.00415.46
7.0.90.0000.01515.09
7.0.80.0100.00315.51
7.0.70.0070.00715.42
7.0.60.0030.01015.39
7.0.50.0030.01015.52
7.0.40.0090.00013.36
7.0.30.0070.00713.66
7.0.20.0060.00313.46
7.0.10.0040.01113.54
7.0.00.0090.00613.34
5.6.400.0070.00714.15
5.6.390.0030.01014.21
5.6.380.0060.00514.17
5.6.370.0000.00913.95
5.6.360.0060.00914.35
5.6.350.0050.00514.15
5.6.340.0040.00714.39
5.6.330.0080.00313.93
5.6.320.0060.00914.16
5.6.310.0060.00914.09
5.6.300.0090.00614.07
5.6.290.0070.00314.29
5.6.280.0070.00714.29
5.6.270.0040.01114.00
5.6.260.0000.01114.25
5.6.250.0000.01314.45
5.6.240.0030.00714.09
5.6.230.0120.00014.13
5.6.220.0000.01514.07
5.6.210.0070.00314.24
5.6.200.0040.01114.13
5.6.190.0090.00314.05
5.6.180.0080.00413.89
5.6.170.0040.01113.89
5.6.160.0080.00414.23
5.6.150.0000.01314.10
5.6.140.0070.00714.25
5.6.130.0060.00614.23
5.6.120.0070.00713.96
5.6.110.0070.00714.08
5.6.100.0080.00413.93
5.6.90.0030.01013.98
5.6.80.0000.01414.27
5.6.70.0080.00614.04
5.6.60.0030.00913.97
5.6.50.0040.01114.03
5.6.40.0080.00414.14
5.6.30.0080.00814.12
5.6.20.0000.01314.20
5.6.10.0040.00813.86
5.6.00.0050.00314.12

preferences:
27.95 ms | 401 KiB | 5 Q