3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo generateKey(); function generateKey() { return base64encode(randBuffer(48)); } function base64encode($buf) { $enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; return $buf; } function randBuffer($n) { //try { //$buf = openssl_random_pseudo_bytes($n); //} catch (Exception $e) { $buf = ""; for ($i = 0; $i < $n; $i++) { $buf .= ord(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.0090.01218.95
7.1.70.0000.00816.86
7.1.60.0040.01619.70
7.1.50.0080.00416.92
7.1.00.0100.06722.42
7.0.200.0040.00416.88
7.0.140.0030.07321.97
7.0.60.0070.04320.03
7.0.50.0030.04017.70
7.0.40.0030.05320.05
7.0.30.0170.04020.16
7.0.20.0200.04320.06
7.0.10.0100.05320.11
7.0.00.0070.04320.18
5.6.280.0030.07320.82
5.6.210.0130.08020.72
5.6.200.0170.04718.19
5.6.190.0030.08720.47
5.6.180.2700.04320.52
5.6.170.0170.04020.54
5.6.160.0100.05320.57
5.6.150.0130.07018.18
5.6.140.0070.08318.24
5.6.130.0030.04318.15
5.6.120.0170.07321.02
5.6.110.0100.08721.11
5.6.100.0070.05020.98
5.6.90.0030.08021.13
5.6.80.0100.07020.38
5.6.70.2970.03720.43
5.5.350.0200.08020.41
5.5.340.0100.07717.94
5.5.330.0070.08020.56
5.5.320.0330.04720.28
5.5.310.0300.04720.37
5.5.300.0070.03717.93
5.5.290.0070.04018.05
5.5.280.0100.08320.96
5.5.270.0070.04020.73
5.5.260.0070.04320.87
5.5.250.0130.07320.47
5.5.240.0270.06020.06
5.4.450.0400.04330.85
5.4.440.0200.04729.93
5.4.430.1170.02719.46
5.4.420.0170.05029.93
5.4.410.0030.04329.93
5.4.400.0500.04329.68
5.4.390.0470.04028.86
5.4.380.0100.05718.75
5.4.370.0170.05018.57
5.4.360.0130.05018.75
5.4.350.0130.05318.63
5.4.340.0230.04318.76
5.4.320.0040.03812.50
5.4.310.0060.03712.50
5.4.300.0050.04712.51
5.4.290.0070.03712.50
5.4.280.0100.03412.40
5.4.270.0060.04112.40
5.4.260.0080.03912.40
5.4.250.0040.04112.40
5.4.240.0090.03612.39
5.4.230.0050.03912.39
5.4.220.0070.03612.39
5.4.210.0080.03612.39
5.4.200.0070.03912.39
5.4.190.0090.03312.38
5.4.180.0070.04412.39
5.4.170.0090.03712.40
5.4.160.0060.04012.39
5.4.150.0050.03912.38
5.4.140.0040.04112.07
5.4.130.0050.03612.06
5.4.120.0090.03312.02
5.4.110.0060.03512.01
5.4.100.0030.03912.02
5.4.90.0030.04012.01
5.4.80.0070.03612.01
5.4.70.0040.03912.01
5.4.60.0060.03512.01
5.4.50.0060.03512.01
5.4.40.0070.03312.00
5.4.30.0070.03311.99
5.4.20.0090.03311.99
5.4.10.0070.03411.99
5.4.00.0080.03511.49
5.3.290.0070.04012.80
5.3.280.0060.03712.71
5.3.270.0070.04012.72
5.3.260.0060.03912.72
5.3.250.0060.03712.71
5.3.240.0090.04012.72
5.3.230.0080.03512.71
5.3.220.0060.04412.68
5.3.210.0070.04512.68
5.3.200.0040.03912.68
5.3.190.0100.03712.68
5.3.180.0080.04212.68
5.3.170.0090.04012.67
5.3.160.0110.03512.67
5.3.150.0060.04012.67
5.3.140.0080.03512.66
5.3.130.0090.03612.66
5.3.120.0070.04112.66
5.3.110.0080.04412.66
5.3.100.0080.04512.13
5.3.90.0070.04112.11
5.3.80.0120.03412.10
5.3.70.0080.03612.10
5.3.60.0080.03412.08
5.3.50.0030.04112.03
5.3.40.0090.03712.03
5.3.30.0060.03611.99
5.3.20.0060.03911.77
5.3.10.0060.03611.74
5.3.00.0060.03611.73
5.2.170.0040.0329.23
5.2.160.0090.0269.23
5.2.150.0060.0299.23
5.2.140.0060.0309.23
5.2.130.0040.0309.19
5.2.120.0020.0319.19
5.2.110.0040.0299.20
5.2.100.0070.0289.18
5.2.90.0080.0289.19
5.2.80.0050.0309.18
5.2.70.0050.0299.18
5.2.60.0060.0299.14
5.2.50.0040.0359.11
5.2.40.0030.0389.08
5.2.30.0040.0309.06
5.2.20.0060.0329.04
5.2.10.0030.0308.95
5.2.00.0040.0308.81
5.1.60.0050.0308.09
5.1.50.0050.0298.09
5.1.40.0070.0218.07
5.1.30.0060.0328.42
5.1.20.0040.0278.44
5.1.10.0070.0238.17
5.1.00.0080.0298.17
5.0.50.0040.0256.64
5.0.40.0060.0226.51
5.0.30.0030.0326.32
5.0.20.0000.0226.28
5.0.10.0030.0206.27
5.0.00.0020.0326.25
4.4.90.0030.0154.78
4.4.80.0020.0164.75
4.4.70.0030.0164.75
4.4.60.0020.0164.75
4.4.50.0060.0134.77
4.4.40.0030.0264.70
4.4.30.0010.0174.76
4.4.20.0020.0164.84
4.4.10.0020.0164.85
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0030.0154.67
4.3.90.0020.0154.64
4.3.80.0030.0254.58
4.3.70.0020.0164.63
4.3.60.0040.0174.63
4.3.50.0030.0224.63
4.3.40.0040.0304.54
4.3.30.0040.0143.30
4.3.20.0010.0173.29
4.3.10.0020.0173.25
4.3.00.0100.01728.29

preferences:
36.49 ms | 400 KiB | 5 Q