3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(42); for ($i = 0; $i < 20; $i++) { echo generateKey() . "\n"; } function generateKey() { return base64_urlencode(randBuffer(48)); } function base64_urlencode($buf) { return str_replace(array('+', '/', '='), array('-', '_', ''), base64_encode($buf)); } function randBuffer($n) { //try { // $buf = openssl_random_pseudo_bytes($n); //} catch (Exception $e) { $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.4.00.0070.01114.91
7.3.120.0060.01315.15
7.3.110.0070.00714.74
7.3.100.0060.00914.95
7.3.90.0040.01414.88
7.3.80.0040.01214.70
7.3.70.0070.01014.82
7.3.60.0070.00714.93
7.3.50.0100.00714.78
7.3.40.0090.00414.79
7.3.30.0000.00914.82
7.3.20.0060.00916.83
7.3.10.0060.00616.33
7.3.00.0030.01216.80
7.2.250.0110.00714.82
7.2.240.0070.01414.84
7.2.230.0160.00315.00
7.2.220.0080.00815.20
7.2.210.0090.00915.08
7.2.200.0060.00914.98
7.2.190.0120.00015.09
7.2.180.0120.00314.82
7.2.170.0090.00915.07
7.2.00.0080.00819.72
7.1.330.0070.01015.82
7.1.320.0060.00915.93
7.1.310.0000.01115.82
7.1.300.0060.00915.89
7.1.290.0090.00615.73
7.1.280.0000.01215.61
7.1.270.0070.00715.81
7.1.260.0040.00815.77
7.1.70.0030.00516.93
7.1.60.0120.00417.09
7.1.50.0030.01016.69
7.1.00.0000.08022.36
7.0.200.0030.01316.77
7.0.140.0070.06322.21
7.0.60.0070.05720.04
7.0.50.0030.08317.85
7.0.40.0030.04320.02
7.0.30.0330.07320.08
7.0.20.0230.08320.30
7.0.10.0030.04720.07
7.0.00.0100.07320.32
5.6.280.0000.07721.03
5.6.210.0170.07020.67
5.6.200.0070.09018.17
5.6.190.0030.04320.46
5.6.180.3500.04720.68
5.6.170.0270.07720.57
5.6.160.0100.03720.55
5.6.150.0100.08318.34
5.6.140.0030.08718.20
5.6.130.0170.06318.23
5.6.120.0130.07720.99
5.6.110.0130.06721.04
5.6.100.0030.04021.11
5.6.90.0100.08021.11
5.6.80.0130.06320.29
5.6.70.4330.04020.46
5.5.350.0300.06720.47
5.5.340.0100.07717.99
5.5.330.0070.07720.40
5.5.320.3630.04320.38
5.5.310.0300.08020.34
5.5.300.0030.08017.94
5.5.290.0070.08017.97
5.5.280.0070.03720.97
5.5.270.0100.07320.98
5.5.260.0030.08720.68
5.5.250.0030.07020.57
5.5.240.0230.07720.20
5.4.450.0230.04329.93
5.4.440.0200.04729.93
5.4.430.0270.04329.93
5.4.420.0400.04029.93
5.4.410.0370.03029.92
5.4.400.0400.04729.11
5.4.390.0300.04328.29
5.4.380.0830.06318.52
5.4.370.0770.05318.54
5.4.360.0730.05318.46
5.4.350.0800.05318.59
5.4.340.0770.05318.57
5.4.320.0070.03612.50
5.4.310.0040.04512.50
5.4.300.0100.03812.51
5.4.290.0030.06212.51
5.4.280.0080.04912.40
5.4.270.0130.03812.40
5.4.260.0050.04312.40
5.4.250.0070.03812.40
5.4.240.0070.03812.40
5.4.230.0080.03912.39
5.4.220.0070.03612.39
5.4.210.0090.03812.39
5.4.200.0120.04312.39
5.4.190.0090.04112.39
5.4.180.0110.04912.39
5.4.170.0080.04612.39
5.4.160.0120.04712.39
5.4.150.0100.04912.39
5.4.140.0130.06512.07
5.4.130.0150.05312.06
5.4.120.0140.05512.02
5.4.110.0080.06612.02
5.4.100.0160.07212.02
5.4.90.0110.04112.02
5.4.80.0120.03512.02
5.4.70.0050.04312.01
5.4.60.0090.03712.01
5.4.50.0070.04112.01
5.4.40.0110.03812.00
5.4.30.0070.04612.00
5.4.20.0090.04212.00
5.4.10.0180.06412.00
5.4.00.0100.06211.48
5.3.290.0100.03712.80
5.3.280.0090.04412.70
5.3.270.0070.04712.72
5.3.260.0090.05612.72
5.3.250.0070.04512.72
5.3.240.0100.04012.71
5.3.230.0100.06912.71
5.3.220.0060.04812.68
5.3.210.0080.05712.68
5.3.200.0080.04312.68
5.3.190.0130.08712.68
5.3.180.0240.08112.68
5.3.170.0180.08012.66
5.3.160.0170.06312.67
5.3.150.0130.05512.68
5.3.140.0060.05512.66
5.3.130.0110.05212.66
5.3.120.0110.05012.65
5.3.110.0080.05012.66
5.3.100.0070.04812.13
5.3.90.0050.05712.11
5.3.80.0110.04812.10
5.3.70.0110.04312.10
5.3.60.0080.05112.09
5.3.50.0130.04312.03
5.3.40.0070.04812.04
5.3.30.0110.04611.99
5.3.20.0120.04211.78
5.3.10.0080.04711.73
5.3.00.0060.05011.73
5.2.170.0050.0429.23
5.2.160.0080.0399.23
5.2.150.0100.0419.23
5.2.140.0050.0459.23
5.2.130.0080.0419.19
5.2.120.0080.0369.19
5.2.110.0070.0339.20
5.2.100.0080.0389.18
5.2.90.0090.0359.19
5.2.80.0060.0429.18
5.2.70.0080.0409.18
5.2.60.0080.0429.14
5.2.50.0080.0479.11
5.2.40.0090.0379.08
5.2.30.0070.0419.06
5.2.20.0070.0399.04
5.2.10.0080.0378.95
5.2.00.0060.0358.81
5.1.60.0080.0298.10
5.1.50.0040.0358.09
5.1.40.0070.0318.07
5.1.30.0050.0338.42
5.1.20.0080.0308.45
5.1.10.0100.0308.17
5.1.00.0050.0328.17
5.0.50.0090.0246.64
5.0.40.0010.0256.50
5.0.30.0050.0376.32
5.0.20.0060.0216.28
5.0.10.0040.0246.27
5.0.00.0060.0356.26
4.4.90.0040.0194.78
4.4.80.0070.0164.75
4.4.70.0030.0204.75
4.4.60.0030.0204.75
4.4.50.0030.0184.77
4.4.40.0050.0294.70
4.4.30.0050.0174.76
4.4.20.0040.0194.84
4.4.10.0080.0164.85
4.4.00.0040.0294.75
4.3.110.0050.0194.67
4.3.100.0020.0214.67
4.3.90.0050.0174.63
4.3.80.0080.0244.58
4.3.70.0040.0194.63
4.3.60.0030.0194.63
4.3.50.0040.0194.63
4.3.40.0030.0324.54
4.3.30.0030.0183.31
4.3.20.0020.0223.29
4.3.10.0030.0363.25
4.3.00.0070.01728.29

preferences:
37.94 ms | 401 KiB | 5 Q