3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(42); 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.3.10.0080.00616.51
7.3.00.0110.00116.61
7.2.130.0070.00716.94
7.2.120.0060.00816.93
7.2.110.0060.00717.05
7.2.100.0090.00417.00
7.2.90.0030.01017.04
7.2.80.0070.00917.02
7.2.70.0100.00717.02
7.2.60.0100.00516.90
7.2.50.0120.00316.86
7.2.40.0090.00516.83
7.2.30.0050.00716.90
7.2.20.0050.00916.79
7.2.10.0020.01017.04
7.2.00.0100.00616.97
7.1.250.0090.00515.69
7.1.240.0080.00415.81
7.1.230.0070.00715.80
7.1.220.0070.00715.84
7.1.210.0030.00715.64
7.1.200.0070.01115.72
7.1.190.0100.00315.49
7.1.180.0100.00715.49
7.1.170.0120.00315.68
7.1.160.0060.00615.85
7.1.150.0100.00315.77
7.1.140.0110.00715.89
7.1.130.0110.00415.66
7.1.120.0130.00315.54
7.1.110.0100.00315.70
7.1.100.0080.00415.54
7.1.90.0070.00715.68
7.1.80.0030.01015.89
7.1.70.0040.00716.57
7.1.60.0080.01017.62
7.1.50.0080.00816.24
7.1.40.0090.00315.40
7.1.30.0080.00315.59
7.1.20.0100.00315.77
7.1.10.0120.00015.77
7.1.00.0050.04219.05
7.0.330.0130.00315.58
7.0.320.0090.00615.19
7.0.310.0090.00615.25
7.0.300.0030.01015.28
7.0.290.0070.00715.44
7.0.280.0100.00715.21
7.0.270.0110.00415.49
7.0.260.0080.00415.45
7.0.250.0090.00615.63
7.0.240.0140.00315.45
7.0.230.0070.00615.61
7.0.220.0090.00315.54
7.0.210.0160.00315.18
7.0.200.0020.01016.21
7.0.190.0070.00415.55
7.0.180.0120.00415.51
7.0.170.0140.00015.25
7.0.160.0090.00615.44
7.0.150.0090.00615.37
7.0.140.0070.03818.79
7.0.130.0070.01115.14
7.0.120.0090.00915.59
7.0.110.0100.00715.36
7.0.100.0090.00615.51
7.0.90.0060.01015.38
7.0.80.0120.00615.54
7.0.70.0030.01315.20
7.0.60.0090.03817.78
7.0.50.0080.02316.66
7.0.40.0110.04116.83
7.0.30.0150.02516.85
7.0.20.0150.03516.75
7.0.10.0110.03916.85
7.0.00.0080.04216.78
5.6.380.0090.00313.99
5.6.370.0040.00714.27
5.6.360.0100.00014.48
5.6.350.0030.00914.57
5.6.340.0000.00914.30
5.6.330.0100.00314.50
5.6.320.0100.00014.66
5.6.310.0080.00414.40
5.6.300.0130.00014.14
5.6.290.0060.00614.72
5.6.280.0030.04017.75
5.6.270.0030.00814.11
5.6.260.0110.00414.50
5.6.250.0070.00714.25
5.6.240.0070.00714.38
5.6.230.0000.01314.26
5.6.220.0060.00614.37
5.6.210.0100.04017.45
5.6.200.0110.04116.40
5.6.190.0050.05017.59
5.6.180.1820.02217.62
5.6.170.0130.04917.33
5.6.160.0070.04517.33
5.6.150.0070.03016.27
5.6.140.0070.04416.24
5.6.130.0080.02816.27
5.6.120.0030.03517.68
5.6.110.0050.02417.67
5.6.100.0160.03817.44
5.6.90.0050.03917.58
5.6.80.0110.04217.40
5.6.70.0090.00314.27
5.6.60.0040.00814.41
5.6.50.0090.00614.41
5.6.40.0060.00614.18
5.6.30.0060.00614.20
5.6.20.0070.00713.93
5.6.10.0030.01014.18
5.6.00.0110.00414.27
5.5.380.0130.00011.10
5.5.370.0060.00611.06
5.5.360.0000.01311.41
5.5.350.0130.04115.79
5.5.340.0080.01814.69
5.5.330.0080.03815.80
5.5.320.1800.02715.91
5.5.310.0070.03015.74
5.5.300.0030.03614.75
5.5.290.0020.02514.60
5.5.280.0060.04016.06
5.5.270.0030.04716.04
5.5.260.0070.04415.94
5.5.250.0050.04915.73
5.5.240.1850.02015.71
5.5.230.0000.01011.10
5.5.220.0030.01011.11
5.5.210.0040.00711.38
5.5.200.0060.00611.26
5.5.190.0060.00311.12
5.5.180.0030.00711.23
5.5.170.0040.00711.22
5.5.160.0000.01110.95
5.5.150.0000.00810.88
5.5.140.0070.00311.09
5.5.130.0000.00710.98
5.5.120.0070.00011.04
5.5.110.0030.00610.95
5.5.100.0070.00310.95
5.5.90.0030.00711.30
5.5.80.0070.00411.25
5.5.70.0070.00311.03
5.5.60.0090.00310.98
5.5.50.0040.00410.88
5.5.40.0000.01311.03
5.5.30.0060.00811.35
5.5.20.0070.00411.24
5.5.10.0030.00911.14
5.5.00.0060.00611.31
5.4.450.0230.03415.23
5.4.440.0530.03015.31
5.4.430.0600.03015.21
5.4.420.0120.02515.27
5.4.410.0580.03515.29
5.4.400.0480.02715.22
5.4.390.0530.03315.25
5.4.380.0080.03114.85
5.4.370.0120.02715.00
5.4.360.0120.02714.92
5.4.350.0130.03014.94
5.4.340.0100.03014.84
5.4.330.0140.00011.37
5.4.320.0120.02011.83
5.4.310.0050.02211.90
5.4.300.0060.03111.88
5.4.290.0050.03311.64
5.4.280.0090.03011.66
5.4.270.0050.02311.67
5.4.260.0070.02911.61
5.4.250.0060.03211.64
5.4.240.0060.03211.78
5.4.230.0090.03111.68
5.4.220.0070.03011.76
5.4.210.0090.02911.79
5.4.200.0070.02211.72
5.4.190.0060.02211.69
5.4.180.0070.02111.77
5.4.170.0070.02311.83
5.4.160.0080.02211.61
5.4.150.0070.03011.67
5.4.140.0100.02311.60
5.4.130.0110.01911.54
5.4.120.0090.02811.58
5.4.110.0110.02711.52
5.4.100.0090.02811.71
5.4.90.0110.02711.54
5.4.80.0090.02811.54
5.4.70.0090.02611.44
5.4.60.0110.03611.58
5.4.50.0100.02011.63
5.4.40.0080.02211.44
5.4.30.0130.01911.53
5.4.20.0100.02011.44
5.4.10.0100.02111.62
5.4.00.0060.02511.23
5.3.290.0050.02711.75
5.3.280.0050.02511.65
5.3.270.0090.02311.63
5.3.260.0070.02411.65
5.3.250.0070.02411.72
5.3.240.0070.03211.64
5.3.230.0120.02611.59
5.3.220.0090.03211.61
5.3.210.0100.02911.60
5.3.200.0100.03111.51
5.3.190.0100.02811.52
5.3.180.0100.02811.55
5.3.170.0100.03311.67
5.3.160.0100.03111.68
5.3.150.0090.03111.67
5.3.140.0050.03311.49
5.3.130.0100.03211.48
5.3.120.0070.03311.60
5.3.110.0090.03211.51
5.3.100.0080.03111.38
5.3.90.0130.01911.42
5.3.80.0070.02411.32
5.3.70.0090.02111.29
5.3.60.0060.02211.31
5.3.50.0090.02311.26
5.3.40.0070.02111.15
5.3.30.0060.02211.20
5.3.20.0060.02211.05
5.3.10.0040.02410.92
5.3.00.0080.03811.06
5.2.170.0050.0219.47
5.2.160.0110.0469.45
5.2.150.0050.0329.28
5.2.140.0050.0409.25
5.2.130.0020.0289.21
5.2.120.0070.0239.38
5.2.110.0070.0179.40
5.2.100.0040.0199.31
5.2.90.0080.0149.20
5.2.80.0050.0189.29
5.2.70.0040.0189.16
5.2.60.0070.0249.26
5.2.50.0060.0259.12
5.2.40.0030.0229.22
5.2.30.0040.0259.23
5.2.20.0040.0249.18
5.2.10.0020.0249.11
5.2.00.0050.0228.99
5.1.60.0050.0188.34
5.1.50.0050.0188.16
5.1.40.0060.0138.27
5.1.30.0030.0168.44
5.1.20.0050.0158.58
5.1.10.0020.0188.43
5.1.00.0050.0158.37
5.0.50.0050.0137.17
5.0.40.0060.0127.10
5.0.30.0020.0247.01
5.0.20.0020.0146.99
5.0.10.0040.0196.98
5.0.00.0050.0216.97
4.4.90.0020.0156.24
4.4.80.0040.0126.23
4.4.70.0030.0096.23
4.4.60.0020.0126.22
4.4.50.0030.0106.23
4.4.40.0020.0166.20
4.4.30.0030.0096.23
4.4.20.0030.0106.27
4.4.10.0020.0146.27
4.4.00.0020.0156.22
4.3.110.0020.0116.18
4.3.100.0030.0096.18
4.3.90.0020.0106.16
4.3.80.0040.0126.14
4.3.70.0040.0086.16
4.3.60.0040.0096.16
4.3.50.0020.0106.16
4.3.40.0040.0146.12
4.3.30.0020.0135.50
4.3.20.0040.0095.49
4.3.10.0040.0085.47
4.3.00.0090.00717.99

preferences:
40.96 ms | 401 KiB | 5 Q