3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(42); echo generateKey(); function generateKey() { return base64encode(randBuffer(48)); } function base64encode($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.2.00.0070.00419.44
7.1.70.0080.00017.20
7.1.60.0100.01419.70
7.1.50.0040.01816.95
7.1.00.0070.07322.45
7.0.200.0040.00416.85
7.0.140.0000.07022.08
7.0.60.0100.06019.91
7.0.50.0030.07017.89
7.0.40.0170.08020.20
7.0.30.0300.04020.06
7.0.20.0200.06720.23
7.0.10.0130.07020.30
7.0.00.0070.08020.04
5.6.280.0130.06321.00
5.6.210.0030.07720.70
5.6.200.0070.05718.29
5.6.190.0070.04720.45
5.6.180.3400.04020.68
5.6.170.0230.07320.45
5.6.160.0030.09020.61
5.6.150.0130.07018.28
5.6.140.0070.05318.15
5.6.130.0070.08018.16
5.6.120.0130.07320.98
5.6.110.0030.08721.15
5.6.100.0100.06321.04
5.6.90.0070.06321.00
5.6.80.0030.04020.55
5.6.70.3330.03720.44
5.5.350.0300.07020.48
5.5.340.0000.04317.93
5.5.330.0000.04720.40
5.5.320.3230.05020.34
5.5.310.0270.07020.31
5.5.300.0030.05017.93
5.5.290.0200.07017.92
5.5.280.0100.07320.78
5.5.270.0070.06320.77
5.5.260.0170.07320.77
5.5.250.0100.06320.64
5.5.240.0230.07720.13
5.4.450.0270.04729.93
5.4.440.0570.04029.93
5.4.430.0270.04729.93
5.4.420.0200.04029.93
5.4.410.0270.04029.92
5.4.400.0400.03729.48
5.4.390.0100.04028.86
5.4.380.0070.06718.79
5.4.370.0170.05318.57
5.4.360.0200.04718.77
5.4.350.0130.05318.57
5.4.340.0170.06018.74
5.4.320.0050.03612.51
5.4.310.0050.04012.50
5.4.300.0090.05712.51
5.4.290.0130.05112.50
5.4.280.0100.04612.40
5.4.270.0080.04912.40
5.4.260.0090.05112.40
5.4.250.0070.05312.40
5.4.240.0100.05112.40
5.4.230.0100.05312.40
5.4.220.0090.05312.40
5.4.210.0090.05412.39
5.4.200.0100.05112.39
5.4.190.0090.05312.39
5.4.180.0100.05612.39
5.4.170.0100.05312.39
5.4.160.0100.04912.39
5.4.150.0100.05212.39
5.4.140.0110.05612.07
5.4.130.0060.05212.07
5.4.120.0100.04412.02
5.4.110.0120.04412.02
5.4.100.0120.05012.02
5.4.90.0120.04512.02
5.4.80.0100.05112.02
5.4.70.0120.04812.01
5.4.60.0080.04112.01
5.4.50.0080.03912.01
5.4.40.0080.04612.00
5.4.30.0080.04812.00
5.4.20.0100.05012.00
5.4.10.0090.04911.99
5.4.00.0060.05911.48
5.3.290.0110.03312.80
5.3.280.0150.05412.71
5.3.270.0090.06612.72
5.3.260.0120.05912.72
5.3.250.0130.05512.72
5.3.240.0080.06112.72
5.3.230.0120.05612.70
5.3.220.0240.08712.68
5.3.210.0240.11012.68
5.3.200.0250.07812.68
5.3.190.0120.05012.68
5.3.180.0090.05012.68
5.3.170.0130.05312.67
5.3.160.0140.04812.67
5.3.150.0190.13612.67
5.3.140.0220.08712.66
5.3.130.0140.08212.66
5.3.120.0140.04712.66
5.3.110.0110.04912.65
5.3.100.0090.07312.13
5.3.90.0060.05612.11
5.3.80.0120.04212.10
5.3.70.0070.05012.10
5.3.60.0130.05412.08
5.3.50.0110.04612.03
5.3.40.0070.04912.03
5.3.30.0130.04311.99
5.3.20.0060.04911.77
5.3.10.0130.04711.74
5.3.00.0110.04711.73
5.2.170.0060.0429.23
5.2.160.0090.0409.23
5.2.150.0040.0389.23
5.2.140.0060.0409.23
5.2.130.0080.0429.19
5.2.120.0060.0429.19
5.2.110.0090.0369.19
5.2.100.0070.0349.18
5.2.90.0040.0379.18
5.2.80.0030.0419.18
5.2.70.0080.0359.18
5.2.60.0070.0409.14
5.2.50.0100.0379.11
5.2.40.0080.0389.08
5.2.30.0110.0359.05
5.2.20.0130.0329.04
5.2.10.0060.0318.95
5.2.00.0140.0398.81
5.1.60.0080.0418.10
5.1.50.0090.0568.09
5.1.40.0080.0418.07
5.1.30.0060.0448.42
5.1.20.0060.0388.45
5.1.10.0050.0328.17
5.1.00.0070.0278.17
5.0.50.0040.0246.64
5.0.40.0020.0266.51
5.0.30.0040.0346.32
5.0.20.0040.0216.28
5.0.10.0060.0206.27
5.0.00.0040.0336.26
4.4.90.0040.0164.78
4.4.80.0040.0174.75
4.4.70.0020.0204.75
4.4.60.0050.0144.75
4.4.50.0020.0184.77
4.4.40.0050.0254.71
4.4.30.0040.0154.75
4.4.20.0020.0194.84
4.4.10.0040.0164.85
4.4.00.0020.0314.76
4.3.110.0040.0194.67
4.3.100.0040.0174.66
4.3.90.0040.0174.63
4.3.80.0040.0324.58
4.3.70.0030.0214.63
4.3.60.0050.0184.63
4.3.50.0040.0214.63
4.3.40.0030.0294.54
4.3.30.0030.0163.31
4.3.20.0010.0193.29
4.3.10.0020.0173.25
4.3.00.0030.02028.29

preferences:
39.95 ms | 400 KiB | 5 Q