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 .= 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.0100.00714.75
7.3.120.0070.01115.20
7.3.110.0040.01414.91
7.3.100.0030.01414.75
7.3.90.0080.00814.78
7.3.80.0040.01114.76
7.3.70.0100.00014.61
7.3.60.0040.00814.72
7.3.50.0060.00614.74
7.3.40.0000.01114.64
7.3.30.0090.00614.82
7.3.20.0100.00316.70
7.3.10.0050.00816.60
7.3.00.0040.00916.60
7.2.250.0100.00314.89
7.2.240.0090.00614.76
7.2.230.0070.01015.00
7.2.220.0030.01015.12
7.2.210.0080.00414.81
7.2.200.0030.00715.12
7.2.190.0040.00714.97
7.2.180.0000.01415.00
7.2.170.0030.00915.00
7.2.160.0040.01115.12
7.2.150.0100.00716.78
7.2.140.0030.00616.61
7.2.130.0040.01016.93
7.2.120.0060.00616.99
7.2.110.0100.00316.82
7.2.100.0030.00916.98
7.2.90.0020.00916.97
7.2.80.0070.00716.85
7.2.70.0070.00916.94
7.2.60.0050.00816.89
7.2.50.0060.00816.92
7.2.40.0040.01016.86
7.2.30.0060.00516.76
7.2.20.0060.00816.96
7.2.10.0030.01216.93
7.2.00.0050.00817.66
7.1.330.0060.00915.34
7.1.320.0120.00316.00
7.1.310.0030.00615.79
7.1.300.0100.00315.73
7.1.290.0060.00615.50
7.1.280.0030.00715.80
7.1.270.0070.00715.75
7.1.260.0040.00415.73
7.1.250.0050.00915.80
7.1.240.0090.00615.79
7.1.230.0050.00515.75
7.1.220.0030.00715.75
7.1.210.0000.01215.68
7.1.200.0040.01115.76
7.1.190.0060.00615.81
7.1.180.0140.00415.76
7.1.170.0090.00615.53
7.1.160.0000.01215.68
7.1.150.0000.01115.64
7.1.140.0040.00415.77
7.1.130.0080.00415.57
7.1.120.0030.00615.68
7.1.110.0070.00715.84
7.1.100.0070.01015.47
7.1.90.0000.00815.42
7.1.80.0100.00315.63
7.1.70.0050.00716.31
7.1.60.0070.00816.57
7.1.50.0060.01216.15
7.1.40.0070.00715.61
7.1.30.0060.00615.60
7.1.20.0050.00515.75
7.1.10.0070.00715.45
7.1.00.0070.03919.01
7.0.330.0030.01015.06
7.0.320.0070.00715.16
7.0.310.0040.00415.20
7.0.300.0070.00715.21
7.0.290.0080.00415.21
7.0.280.0060.00615.14
7.0.270.0030.00515.29
7.0.260.0030.01014.91
7.0.250.0030.01015.58
7.0.240.0030.01415.37
7.0.230.0150.00015.41
7.0.220.0140.00015.23
7.0.210.0060.00315.11
7.0.200.0080.00816.06
7.0.190.0040.01115.39
7.0.180.0100.00015.30
7.0.170.0000.00915.04
7.0.160.0070.00415.36
7.0.150.0100.00315.29
7.0.140.0030.03618.74
7.0.130.0060.00315.50
7.0.120.0100.00315.24
7.0.110.0070.00715.28
7.0.100.0000.01315.06
7.0.90.0000.01315.14
7.0.80.0060.00315.10
7.0.70.0040.00815.16
7.0.60.0080.03317.56
7.0.50.0080.04016.47
7.0.40.0090.04516.67
7.0.30.0230.03916.70
7.0.20.0150.04116.93
7.0.10.0020.03316.57
7.0.00.0040.05016.73
5.6.400.0030.00914.36
5.6.390.0000.01414.39
5.6.380.0030.01014.39
5.6.370.0100.00614.24
5.6.360.0100.00714.54
5.6.350.0040.01114.05
5.6.340.0000.01714.27
5.6.330.0040.00414.57
5.6.320.0040.00814.10
5.6.310.0050.00313.96
5.6.300.0040.01114.44
5.6.290.0050.00513.97
5.6.280.0060.03717.73
5.6.270.0090.00614.04
5.6.260.0060.01014.09
5.6.250.0040.00714.41
5.6.240.0050.00514.18
5.6.230.0090.00314.07
5.6.220.0080.00414.12
5.6.210.0120.04017.47
5.6.200.0030.03416.34
5.6.190.0030.02517.35
5.6.180.2070.02317.45
5.6.170.0150.03117.35
5.6.160.0040.02317.41
5.6.150.0070.04216.22
5.6.140.0060.03416.21
5.6.130.0030.02616.14
5.6.120.0080.04517.70
5.6.110.0070.04717.57
5.6.100.0060.02117.72
5.6.90.0090.04517.45
5.6.80.0070.03617.30
5.6.70.2180.02817.28
5.6.60.0030.01014.28
5.6.50.0100.00713.91
5.6.40.0060.00814.29
5.6.30.0100.00314.36
5.6.20.0050.00514.27
5.6.10.0030.00813.98
5.6.00.0070.01114.20
5.5.380.0070.00714.16
5.5.370.0000.01114.19
5.5.360.0040.00814.09
5.5.350.0140.04217.22
5.5.340.0000.02916.06
5.5.330.0030.02417.13
5.5.320.1070.03917.20
5.5.310.0150.02817.23
5.5.300.0030.02715.86
5.5.290.0030.03915.98
5.5.280.0030.02617.38
5.5.270.0100.02317.65
5.5.260.0110.04317.51
5.5.250.0090.01917.44
5.5.240.0170.04017.30
5.5.230.0040.01114.20
5.5.220.0030.00714.28
5.5.210.0090.00314.07
5.5.200.0070.00714.25
5.5.190.0000.00914.03
5.5.180.0030.01014.21
5.5.170.0040.01113.89
5.5.160.0030.01314.16
5.5.150.0040.00414.42
5.5.140.0070.01014.32
5.5.130.0030.00713.77
5.5.120.0040.01113.96
5.5.110.0040.01214.08
5.5.100.0070.00713.83
5.5.90.0000.01514.09
5.5.80.0030.00614.11
5.5.70.0060.00614.21
5.5.60.0090.00613.93
5.5.50.0120.00313.79
5.5.40.0030.01314.18
5.5.30.0030.01014.16
5.5.20.0030.00914.27
5.5.10.0030.00813.90
5.5.00.0080.00814.04
5.4.450.0320.02520.50
5.4.440.0200.02520.42
5.4.430.0150.02520.56
5.4.420.0200.01520.50
5.4.410.0120.02820.47
5.4.400.0340.02420.08
5.4.390.0080.02319.70
5.4.380.0070.03014.85
5.4.370.0080.02814.88
5.4.360.0120.02614.85
5.4.350.0050.03014.80
5.4.340.0050.03214.65
5.4.330.0050.00511.10
5.4.320.0070.02211.84
5.4.310.0070.02311.77
5.4.300.0060.02911.75
5.4.290.0040.03411.74
5.4.280.0040.03111.63
5.4.270.0090.02711.60
5.4.260.0080.03011.74
5.4.250.0080.02111.79
5.4.240.0100.02511.73
5.4.230.0060.02711.64
5.4.220.0070.02711.77
5.4.210.0050.02611.64
5.4.200.0050.03011.60
5.4.190.0040.02511.61
5.4.180.0040.02411.61
5.4.170.0050.03011.65
5.4.160.0060.02911.65
5.4.150.0080.02411.74
5.4.140.0080.03111.43
5.4.130.0070.02811.61
5.4.120.0070.02511.40
5.4.110.0070.02411.55
5.4.100.0070.02211.46
5.4.90.0060.02411.40
5.4.80.0040.02411.51
5.4.70.0040.02411.40
5.4.60.0080.02311.46
5.4.50.0060.02211.45
5.4.40.0070.02111.42
5.4.30.0080.02111.55
5.4.20.0060.02111.61
5.4.10.0070.01911.54
5.4.00.0070.02011.29
5.3.290.0080.02311.80
5.3.280.0090.01911.75
5.3.270.0060.02411.76
5.3.260.0060.02311.76
5.3.250.0030.02411.76
5.3.240.0040.02111.76
5.3.230.0030.02111.75
5.3.220.0050.02311.73
5.3.210.0060.02511.74
5.3.200.0040.02211.73
5.3.190.0040.02311.74
5.3.180.0020.02411.73
5.3.170.0040.02211.73
5.3.160.0070.02411.73
5.3.150.0040.02211.73
5.3.140.0060.02211.73
5.3.130.0040.02111.73
5.3.120.0030.02411.72
5.3.110.0080.02011.72
5.3.100.0090.01911.46
5.3.90.0030.02311.45
5.3.80.0060.02411.44
5.3.70.0070.01911.44
5.3.60.0060.02011.44
5.3.50.0020.02511.41
5.3.40.0040.02511.41
5.3.30.0070.01911.39
5.3.20.0040.02311.28
5.3.10.0080.02011.26
5.3.00.0050.02111.26
5.2.170.0070.0339.23
5.2.160.0050.0319.23
5.2.150.0040.0319.23
5.2.140.0070.0299.22
5.2.130.0060.0289.18
5.2.120.0070.0289.19
5.2.110.0040.0299.19
5.2.100.0050.0289.18
5.2.90.0040.0309.18
5.2.80.0030.0329.18
5.2.70.0060.0329.18
5.2.60.0090.0289.14
5.2.50.0060.0319.10
5.2.40.0040.0309.08
5.2.30.0050.0309.05
5.2.20.0050.0299.04
5.2.10.0050.0308.95
5.2.00.0050.0308.81
5.1.60.0080.0218.09
5.1.50.0060.0248.09
5.1.40.0020.0278.07
5.1.30.0080.0228.42
5.1.20.0040.0278.44
5.1.10.0030.0288.17
5.1.00.0090.0228.16
5.0.50.0050.0206.64
5.0.40.0050.0196.50
5.0.30.0040.0326.31
5.0.20.0030.0216.28
5.0.10.0040.0206.27
5.0.00.0050.0296.25
4.4.90.0030.0164.78
4.4.80.0020.0164.75
4.4.70.0030.0164.75
4.4.60.0020.0164.76
4.4.50.0030.0204.77
4.4.40.0050.0274.71
4.4.30.0020.0164.76
4.4.20.0020.0194.85
4.4.10.0020.0204.85
4.4.00.0040.0254.76
4.3.110.0060.0124.67
4.3.100.0010.0174.66
4.3.90.0050.0134.64
4.3.80.0040.0314.59
4.3.70.0070.0154.63
4.3.60.0040.0184.62
4.3.50.0040.0194.62
4.3.40.0080.0214.54
4.3.30.0050.0173.31
4.3.20.0040.0163.28
4.3.10.0010.0173.25
4.3.00.0030.01328.29

preferences:
39.26 ms | 401 KiB | 5 Q