3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(42); for ($i = 0; $i < 20; $i++) { echo generate_key() . "\n"; } function generate_key() { return base64_urlencode(rand_buffer(48)); } function base64_urlencode($buf) { return str_replace(array('+', '/', '='), array('-', '_', ''), base64_encode($buf)); } function rand_buffer($n) { if (function_exists("openssl_random_pseudo_bytes")) { return openssl_random_pseudo_bytes($n); } $buf = ""; for ($i = 0; $i < $n; $i++) { $buf .= chr(mt_rand(0, 255)); } return $buf; }

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.0080.00816.78
7.3.00.0110.00316.46
7.2.130.0030.01016.77
7.2.120.0110.00316.99
7.2.110.0110.00416.98
7.2.100.0090.00316.64
7.2.90.0070.00417.03
7.2.80.0080.00816.89
7.2.70.0060.00916.85
7.2.60.0030.01216.58
7.2.50.0060.00816.77
7.2.40.0160.00316.48
7.2.30.0150.00016.75
7.2.20.0050.00817.09
7.2.10.0120.00017.01
7.2.00.0020.01318.12
7.1.250.0110.00415.79
7.1.70.0040.00417.05
7.1.60.0070.02019.70
7.1.50.0090.00917.08
7.1.00.0130.07022.54
7.0.200.0070.00316.85
7.0.140.0070.06722.13
7.0.60.0130.04320.09
7.0.50.0000.04717.93
7.0.40.0100.08320.37
7.0.30.0270.04020.24
7.0.20.0230.09020.09
7.0.10.0030.05720.15
7.0.00.0100.07720.31
5.6.280.0030.07321.16
5.6.210.0100.07020.57
5.6.200.0130.06018.22
5.6.190.0130.08320.64
5.6.180.3600.03320.48
5.6.170.0370.06720.47
5.6.160.0070.08720.58
5.6.150.0100.05718.27
5.6.140.0130.08018.25
5.6.130.0070.07718.30
5.6.120.0100.08021.06
5.6.110.0100.06321.18
5.6.100.0070.06321.16
5.6.90.0170.07720.98
5.6.80.0030.06720.42
5.6.70.4900.03020.38
5.5.350.0230.07320.42
5.5.340.0070.08318.15
5.5.330.0070.04020.32
5.5.320.0330.05020.28
5.5.310.0370.07320.48
5.5.300.0030.04018.04
5.5.290.0030.08317.96
5.5.280.0130.07720.89
5.5.270.0100.08320.84
5.5.260.0070.07020.91
5.5.250.0200.07320.73
5.5.240.0130.03720.33
5.4.450.0000.08719.34
5.4.440.0070.06019.42
5.4.430.0030.08019.61
5.4.420.0030.07719.60
5.4.410.0030.04719.39
5.4.400.0030.07019.22
5.4.390.0000.05319.10
5.4.380.0030.04718.91
5.4.370.0070.03719.05
5.4.360.0000.04019.01
5.4.350.0030.03319.07
5.4.340.0030.04319.08
5.4.320.0000.03719.29
5.4.310.0000.04318.87
5.4.300.0030.03319.11
5.4.290.0000.04018.87
5.4.280.0070.03019.06
5.4.270.0030.03719.05
5.4.260.0030.04019.37
5.4.250.0070.03319.19
5.4.240.0030.03319.19
5.4.230.0000.03719.27
5.4.220.0000.04019.18
5.4.210.0000.04319.07
5.4.200.0030.03319.09
5.4.190.0170.07018.86
5.4.180.0030.04019.28
5.4.170.0070.05718.88
5.4.160.0130.04319.36
5.4.150.0070.07318.96
5.4.140.0030.05016.40
5.4.130.0030.07316.52
5.4.120.0030.05016.55
5.4.110.0030.04316.24
5.4.100.0100.03016.31
5.4.90.0030.07316.63
5.4.80.0030.05316.49
5.4.70.0030.04716.58
5.4.60.0070.05016.52
5.4.50.0100.06316.16
5.4.40.0000.05016.53
5.4.30.0100.06016.35
5.4.20.0070.06016.55
5.4.10.0030.07016.25
5.4.00.0030.05315.91
5.3.290.0030.03714.69
5.3.280.0000.04014.52
5.3.270.0030.06314.69
5.3.260.0070.08014.84
5.3.250.0070.04014.83
5.3.240.0130.04714.63
5.3.230.0030.08014.50
5.3.220.0000.04714.73
5.3.210.0030.04714.54
5.3.200.0100.05314.49
5.3.190.0030.07314.62
5.3.180.0000.07014.59
5.3.170.0030.05314.46
5.3.160.0030.03714.65
5.3.150.0100.07014.58
5.3.140.0030.05714.46
5.3.130.0030.07714.47
5.3.120.0130.07014.45
5.3.110.0000.08014.55
5.3.100.0030.07313.96
5.3.90.0070.06714.00
5.3.80.0030.07014.11
5.3.70.0000.04313.93
5.3.60.0000.05314.23
5.3.50.0070.03714.18
5.3.40.0070.07014.07
5.3.30.0100.06313.89
5.3.20.0030.05713.66
5.3.10.0070.07013.70
5.3.00.0030.05313.73
5.2.170.0030.05012.53
5.2.160.0030.06012.53
5.2.150.0070.05012.53
5.2.140.0030.05312.53
5.2.130.0170.04012.53
5.2.120.0000.06712.53
5.2.110.0000.06012.53
5.2.100.0070.04712.53
5.2.90.0030.06012.53
5.2.80.0030.04312.53
5.2.70.0070.03312.53
5.2.60.0000.06012.53
5.2.50.0100.05712.53
5.2.40.0030.06012.53
5.2.30.0000.05312.53
5.2.20.0000.06012.53
5.2.10.0030.05712.53
5.2.00.0070.06712.53
5.1.60.0000.03312.53
5.1.50.0030.03312.53
5.1.40.0000.04312.53
5.1.30.0030.05712.53
5.1.20.0000.04712.53
5.1.10.0000.03312.53
5.1.00.0030.03712.53
5.0.50.0030.04712.53
5.0.40.0070.04012.53
5.0.30.0100.06012.53
5.0.20.0070.02312.53
5.0.10.0000.03312.53
5.0.00.0070.04012.53
4.4.90.0000.02312.53
4.4.80.0000.03312.53
4.4.70.0000.02712.53
4.4.60.0000.03712.53
4.4.50.0030.02312.53
4.4.40.0030.03012.53
4.4.30.0000.02712.53
4.4.20.0000.02312.53
4.4.10.0000.02012.53
4.4.00.0030.03312.53
4.3.110.0000.03312.53
4.3.100.0070.01712.53
4.3.90.0030.03312.53
4.3.80.0030.05312.53
4.3.70.0070.02712.53
4.3.60.0000.02312.53
4.3.50.0030.03712.53
4.3.40.0030.05012.53
4.3.30.0030.03012.53
4.3.20.0000.04012.53
4.3.10.0000.03712.53
4.3.00.0030.02712.53

preferences:
40.38 ms | 401 KiB | 5 Q