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_encode(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.0110.00715.08
7.3.120.0060.01214.88
7.3.110.0090.00615.15
7.3.100.0040.00715.13
7.3.90.0000.01414.71
7.3.80.0100.00614.77
7.3.70.0040.00414.93
7.3.60.0030.01014.95
7.3.50.0070.01014.97
7.3.40.0000.00914.55
7.3.30.0110.00314.52
7.3.20.0060.00616.70
7.3.10.0060.00716.81
7.3.00.0020.01016.48
7.2.250.0140.00415.07
7.2.240.0030.01715.02
7.2.230.0000.01514.68
7.2.220.0040.01215.20
7.2.210.0100.00714.89
7.2.200.0000.01215.08
7.2.190.0040.00715.03
7.2.180.0060.00614.98
7.2.170.0060.00315.17
7.2.130.0080.00416.97
7.2.120.0120.00316.72
7.2.110.0080.00416.95
7.2.100.0000.00816.84
7.2.90.0110.00016.99
7.2.80.0060.01216.85
7.2.70.0070.00317.03
7.2.60.0090.00616.97
7.2.50.0090.00617.02
7.2.40.0030.00616.91
7.2.30.0040.00717.04
7.2.20.0070.00716.86
7.2.10.0030.01216.91
7.2.00.0050.00518.14
7.1.330.0040.01116.02
7.1.320.0030.00915.83
7.1.310.0070.00715.71
7.1.300.0000.01115.82
7.1.290.0110.00015.52
7.1.280.0030.00615.87
7.1.270.0080.00015.76
7.1.260.0060.00615.78
7.1.250.0060.00315.63
7.1.70.0000.01117.26
7.1.60.0030.01019.70
7.1.50.0040.00716.97
7.1.00.0070.07322.54
7.0.200.0000.00916.93
7.0.140.0100.06722.01
7.0.60.0170.07719.95
7.0.50.0000.05717.88
7.0.40.0000.05720.15
7.0.30.0330.08320.07
7.0.20.0300.06020.21
7.0.10.0070.06720.33
7.0.00.0030.09320.05
5.6.280.0030.07021.04
5.6.210.0100.07720.70
5.6.200.0030.08318.18
5.6.190.0070.04320.45
5.6.180.0300.05020.34
5.6.170.0500.07320.39
5.6.160.0070.04020.51
5.6.150.0070.03718.21
5.6.140.0030.04318.14
5.6.130.0170.03718.19
5.6.120.0100.04720.98
5.6.110.0130.07721.04
5.6.100.0030.04321.12
5.6.90.0000.04720.98
5.6.80.0170.06720.40
5.6.70.4600.03720.51
5.5.350.0070.05320.33
5.5.340.0030.06717.97
5.5.330.0200.06020.41
5.5.320.0130.06320.34
5.5.310.0370.06720.31
5.5.300.0170.06718.07
5.5.290.0170.07718.02
5.5.280.0000.05020.98
5.5.270.0070.08320.87
5.5.260.0130.05320.80
5.5.250.0030.06720.70
5.5.240.0330.06320.28
5.4.450.0070.05032.18
5.4.440.0230.04729.93
5.4.430.0330.04729.93
5.4.420.0330.03729.93
5.4.410.0230.04729.92
5.4.400.0600.04729.34
5.4.390.0400.04328.29
5.4.380.0170.05018.49
5.4.370.0230.06718.72
5.4.360.0130.05018.75
5.4.350.0170.07718.83
5.4.340.0030.06318.78
5.4.320.0070.03512.51
5.4.310.0090.03912.50
5.4.300.0090.03712.51
5.4.290.0040.04312.50
5.4.280.0050.03812.41
5.4.270.0090.03712.40
5.4.260.0080.04412.40
5.4.250.0090.03812.40
5.4.240.0090.03712.41
5.4.230.0090.04712.40
5.4.220.0110.03812.40
5.4.210.0100.04412.40
5.4.200.0060.04012.40
5.4.190.0110.05312.39
5.4.180.0170.04512.39
5.4.170.0110.05412.40
5.4.160.0060.05412.39
5.4.150.0100.05012.39
5.4.140.0070.03712.07
5.4.130.0060.04812.06
5.4.120.0050.04012.02
5.4.110.0050.04212.02
5.4.100.0050.03712.02
5.4.90.0120.04412.02
5.4.80.0110.04912.02
5.4.70.0080.05012.01
5.4.60.0100.03212.02
5.4.50.0040.04212.02
5.4.40.0100.03612.00
5.4.30.0060.03812.00
5.4.20.0080.03511.99
5.4.10.0050.03812.00
5.4.00.0100.03511.49
5.3.290.0090.03612.80
5.3.280.0100.05112.71
5.3.270.0090.04112.73
5.3.260.0080.04012.72
5.3.250.0070.03812.72
5.3.240.0050.04012.72
5.3.230.0090.03612.71
5.3.220.0110.03812.68
5.3.210.0120.04912.68
5.3.200.0080.05012.68
5.3.190.0060.04312.68
5.3.180.0050.03912.68
5.3.170.0090.03612.67
5.3.160.0130.03712.68
5.3.150.0080.05412.67
5.3.140.0120.04812.66
5.3.130.0080.04012.66
5.3.120.0090.04512.66
5.3.110.0090.04412.66
5.3.100.0080.06212.12
5.3.90.0130.05312.10
5.3.80.0030.05412.10
5.3.70.0130.03712.10
5.3.60.0100.04012.08
5.3.50.0080.03812.03
5.3.40.0080.04212.03
5.3.30.0100.03611.99
5.3.20.0060.04111.78
5.3.10.0070.04211.74
5.3.00.0080.04711.72
5.2.170.0070.0359.23
5.2.160.0060.0339.23
5.2.150.0060.0389.23
5.2.140.0080.0419.23
5.2.130.0090.0389.19
5.2.120.0070.0399.19
5.2.110.0080.0379.19
5.2.100.0060.0399.18
5.2.90.0040.0369.18
5.2.80.0050.0329.18
5.2.70.0050.0329.18
5.2.60.0030.0339.14
5.2.50.0040.0319.11
5.2.40.0050.0289.09
5.2.30.0050.0309.05
5.2.20.0050.0299.04
5.2.10.0070.0268.95
5.2.00.0070.0298.81
5.1.60.0040.0258.09
5.1.50.0050.0308.09
5.1.40.0030.0278.07
5.1.30.0100.0248.42
5.1.20.0040.0338.45
5.1.10.0040.0288.17
5.1.00.0050.0268.17
5.0.50.0040.0216.65
5.0.40.0020.0226.50
5.0.30.0040.0336.32
5.0.20.0050.0186.28
5.0.10.0030.0216.26
5.0.00.0030.0346.25
4.4.90.0030.0164.78
4.4.80.0020.0174.75
4.4.70.0030.0164.76
4.4.60.0040.0154.76
4.4.50.0020.0174.77
4.4.40.0040.0254.71
4.4.30.0020.0174.76
4.4.20.0040.0164.85
4.4.10.0020.0174.85
4.4.00.0060.0284.76
4.3.110.0030.0164.67
4.3.100.0030.0154.66
4.3.90.0010.0174.63
4.3.80.0060.0224.58
4.3.70.0030.0154.63
4.3.60.0020.0164.63
4.3.50.0020.0174.63
4.3.40.0020.0264.54
4.3.30.0020.0173.31
4.3.20.0020.0173.29
4.3.10.0020.0173.25
4.3.00.0030.02028.29

preferences:
36.47 ms | 401 KiB | 5 Q