3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo generateKey(); function generateKey() { return base64encode(randBuffer(48)); } function base64encode($buf) { $enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; return $enc; } 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.4.00.0070.00714.95
7.3.120.0070.01014.75
7.3.110.0040.01114.39
7.3.100.0070.00714.69
7.3.90.0070.00714.91
7.3.80.0040.00714.61
7.3.70.0070.00714.89
7.3.60.0030.00614.59
7.3.50.0060.01014.81
7.3.40.0000.01414.68
7.3.30.0100.00314.80
7.3.20.0100.01016.56
7.3.10.0100.00716.64
7.3.00.0070.00716.59
7.2.250.0130.01015.21
7.2.240.0100.01014.86
7.2.230.0040.01114.95
7.2.220.0030.00915.17
7.2.210.0030.00714.91
7.2.200.0000.01314.74
7.2.190.0000.01514.98
7.2.180.0040.00814.69
7.2.170.0110.00715.00
7.1.330.0060.00915.76
7.1.320.0070.00415.91
7.1.310.0030.00915.73
7.1.300.0040.00815.79
7.1.290.0070.00315.68
7.1.280.0030.01415.68
7.1.270.0000.01715.64
7.1.260.0060.01215.77
7.1.70.0040.00817.25
7.1.60.0100.00319.70
7.1.50.0030.00916.89
7.1.00.0030.07722.31
7.0.200.0000.00816.97
7.0.140.0000.07022.01
7.0.60.0030.07720.05
7.0.50.0070.05017.95
7.0.40.0030.04720.09
7.0.30.0200.04320.07
7.0.20.0200.07320.07
7.0.10.0030.09720.23
7.0.00.0030.04720.22
5.6.280.0030.07320.78
5.6.210.0130.07720.48
5.6.200.0070.03718.24
5.6.190.0130.07020.52
5.6.180.0030.04020.48
5.6.170.0230.04720.57
5.6.160.0170.04720.61
5.6.150.0070.05318.14
5.6.140.0130.04018.23
5.6.130.0030.05718.18
5.6.120.0130.07721.01
5.6.110.0070.08020.89
5.6.100.0030.04021.05
5.6.90.0130.07721.17
5.6.80.0070.06020.29
5.6.70.4000.03720.49
5.5.350.0070.08320.37
5.5.340.0000.04017.98
5.5.330.0070.08320.46
5.5.320.0030.04320.57
5.5.310.0330.07320.23
5.5.300.0000.09017.97
5.5.290.0100.08318.02
5.5.280.0030.06320.66
5.5.270.0000.08020.93
5.5.260.0100.07320.77
5.5.250.0170.07720.57
5.5.240.0230.07020.30
5.4.450.0170.05030.86
5.4.440.0130.05030.86
5.4.430.0270.05029.93
5.4.420.0370.03029.93
5.4.410.0200.04029.93
5.4.400.0430.03329.93
5.4.390.0200.04329.93
5.4.380.0070.05718.84
5.4.370.0070.05718.83
5.4.360.0170.04718.73
5.4.350.0100.05018.59
5.4.340.0030.06018.56
5.4.320.0060.04112.50
5.4.310.0040.04112.50
5.4.300.0080.03712.50
5.4.290.0020.04312.50
5.4.280.0120.03112.40
5.4.270.0070.04712.39
5.4.260.0090.04312.40
5.4.250.0040.04412.40
5.4.240.0070.03612.40
5.4.230.0040.04212.39
5.4.220.0060.03612.39
5.4.210.0090.03312.39
5.4.200.0060.03912.39
5.4.190.0070.03512.39
5.4.180.0120.04712.39
5.4.170.0070.05112.39
5.4.160.0070.03712.39
5.4.150.0100.04412.38
5.4.140.0040.04412.07
5.4.130.0090.03412.05
5.4.120.0050.03712.02
5.4.110.0070.03812.01
5.4.100.0080.03512.01
5.4.90.0040.04212.01
5.4.80.0040.04112.01
5.4.70.0090.03512.01
5.4.60.0080.03812.01
5.4.50.0100.03612.01
5.4.40.0070.03612.00
5.4.30.0080.03511.99
5.4.20.0050.03712.00
5.4.10.0050.03711.99
5.4.00.0070.05011.49
5.3.290.0070.04012.80
5.3.280.0120.04612.71
5.3.270.0080.06112.72
5.3.260.0110.05312.72
5.3.250.0070.05412.72
5.3.240.0150.05812.72
5.3.230.0080.04112.71
5.3.220.0070.04412.68
5.3.210.0080.04412.68
5.3.200.0050.04012.68
5.3.190.0050.03912.68
5.3.180.0060.03812.67
5.3.170.0070.03512.67
5.3.160.0080.03512.67
5.3.150.0080.05412.68
5.3.140.0080.04112.66
5.3.130.0090.03912.66
5.3.120.0060.04112.65
5.3.110.0070.03912.66
5.3.100.0080.03612.13
5.3.90.0060.03812.11
5.3.80.0070.03512.10
5.3.70.0060.03812.10
5.3.60.0070.03812.09
5.3.50.0070.03912.03
5.3.40.0090.03712.03
5.3.30.0080.03912.00
5.3.20.0060.03811.77
5.3.10.0050.03811.74
5.3.00.0060.04711.72
5.2.170.0050.0429.23
5.2.160.0070.0379.23
5.2.150.0040.0339.23
5.2.140.0060.0339.23
5.2.130.0060.0309.19
5.2.120.0060.0299.19
5.2.110.0060.0309.18
5.2.100.0050.0329.19
5.2.90.0060.0329.19
5.2.80.0080.0309.18
5.2.70.0030.0349.18
5.2.60.0060.0329.14
5.2.50.0040.0339.11
5.2.40.0100.0259.08
5.2.30.0050.0349.05
5.2.20.0090.0289.05
5.2.10.0130.0228.95
5.2.00.0080.0288.81
5.1.60.0070.0268.09
5.1.50.0070.0328.09
5.1.40.0060.0348.08
5.1.30.0040.0388.42
5.1.20.0080.0358.45
5.1.10.0040.0348.17
5.1.00.0040.0348.17
5.0.50.0070.0236.65
5.0.40.0040.0266.51
5.0.30.0050.0396.32
5.0.20.0060.0236.29
5.0.10.0040.0266.27
5.0.00.0030.0366.26
4.4.90.0080.0114.78
4.4.80.0040.0164.75
4.4.70.0060.0154.75
4.4.60.0050.0194.75
4.4.50.0050.0194.77
4.4.40.0050.0304.71
4.4.30.0020.0184.76
4.4.20.0030.0174.84
4.4.10.0050.0144.85
4.4.00.0050.0234.76
4.3.110.0030.0164.67
4.3.100.0030.0154.67
4.3.90.0050.0134.63
4.3.80.0050.0224.58
4.3.70.0050.0124.63
4.3.60.0060.0114.63
4.3.50.0050.0134.63
4.3.40.0070.0204.54
4.3.30.0040.0143.30
4.3.20.0000.0183.28
4.3.10.0030.0153.25
4.3.00.0100.01729.93

preferences:
25.63 ms | 401 KiB | 5 Q