3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(43); for ($i = 0; $i < 20; $i++) { echo_key(); } function echo_key() { $buf = rand_buffer(48); echo base64_encode($buf) . "\n"; echo base64_urlencode($buf) . "\n"; } function base64_urlencode($buf) { return str_replace(array('+', '/', '='), array('-', '_', ''), base64_encode($buf)); } function rand_buffer($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.10.0030.01615.14
7.4.00.0100.00714.89
7.3.130.0070.00714.60
7.3.120.0090.00914.97
7.3.110.0060.01014.88
7.3.100.0090.00615.05
7.3.90.0120.00314.96
7.3.80.0000.01615.10
7.3.70.0060.00914.74
7.3.60.0030.01114.94
7.3.50.0060.00914.96
7.3.40.0030.00714.86
7.3.30.0060.00914.40
7.3.20.0110.00316.66
7.3.10.0000.01116.73
7.3.00.0040.01116.61
7.2.260.0040.01514.99
7.2.250.0070.01115.23
7.2.240.0040.01214.82
7.2.230.0060.00915.25
7.2.220.0030.01314.91
7.2.210.0040.01415.13
7.2.200.0030.01015.16
7.2.190.0060.01015.10
7.2.180.0030.01315.17
7.2.170.0100.00715.13
7.2.160.0000.01115.03
7.2.150.0100.00316.86
7.2.140.0100.00316.89
7.2.130.0120.00616.88
7.2.120.0080.00416.96
7.2.110.0100.00716.93
7.2.100.0130.00616.92
7.2.90.0030.01717.10
7.2.80.0060.00917.01
7.2.70.0000.01317.05
7.2.60.0070.01116.87
7.2.50.0070.01016.77
7.2.40.0080.00416.81
7.2.30.0070.01016.70
7.2.20.0100.00716.74
7.2.10.0080.00416.70
7.2.00.0050.01117.97
7.1.330.0140.00015.59
7.1.320.0090.00615.82
7.1.310.0060.00915.93
7.1.300.0000.01815.66
7.1.290.0000.01415.91
7.1.280.0070.00715.86
7.1.270.0070.00415.78
7.1.260.0060.00915.84
7.1.250.0070.01015.84
7.1.240.0110.00415.80
7.1.230.0030.01315.46
7.1.220.0000.01615.75
7.1.210.0100.01015.67
7.1.200.0120.00315.67
7.1.190.0100.00715.90
7.1.180.0070.00715.97
7.1.170.0030.01215.86
7.1.160.0100.00315.63
7.1.150.0060.00615.80
7.1.140.0040.00815.73
7.1.130.0030.00915.57
7.1.120.0100.00316.00
7.1.110.0000.01015.91
7.1.100.0070.00716.02
7.1.90.0090.00315.66
7.1.80.0060.00615.69
7.1.70.0000.01016.44
7.1.60.0030.01017.74
7.1.50.0050.01016.23
7.1.40.0070.00715.79
7.1.30.0100.00315.61
7.1.20.0000.01215.75
7.1.10.0100.01015.45
7.1.00.0050.04418.98
7.0.330.0040.01215.49
7.0.320.0090.00615.41
7.0.310.0060.00915.37
7.0.300.0000.01515.54
7.0.290.0080.00415.19
7.0.280.0030.00615.62
7.0.270.0000.01415.49
7.0.260.0070.00715.30
7.0.250.0070.01015.61
7.0.240.0000.01115.47
7.0.230.0080.00815.43
7.0.220.0000.01615.37
7.0.210.0070.01015.58
7.0.200.0060.00616.12
7.0.190.0110.00715.61
7.0.180.0070.01115.31
7.0.170.0030.00915.25
7.0.160.0000.01515.24
7.0.150.0080.00615.33
7.0.140.0070.03918.83
7.0.130.0030.00715.45
7.0.120.0070.00715.13
7.0.110.0060.01115.49
7.0.100.0040.01415.43
7.0.90.0030.01015.49
7.0.80.0060.00915.39
7.0.70.0110.00015.32
7.0.60.0050.04517.74
7.0.50.0080.04516.72
7.0.40.0030.04216.74
7.0.30.0120.04416.94
7.0.20.0120.03716.72
7.0.10.0070.04716.88
7.0.00.0050.04316.80
5.6.400.0070.00714.18
5.6.390.0000.00914.60
5.6.380.0080.00514.70
5.6.370.0060.00814.16
5.6.360.0110.00414.10
5.6.350.0060.00614.41
5.6.340.0030.01014.49
5.6.330.0060.00614.52
5.6.320.0080.00414.30
5.6.310.0100.00614.18
5.6.300.0060.01214.70
5.6.290.0030.01414.55
5.6.280.0050.04017.67
5.6.270.0060.01114.65
5.6.260.0030.01414.53
5.6.250.0040.00714.39
5.6.240.0090.00614.16
5.6.230.0060.01014.29
5.6.220.0030.01314.37
5.6.210.0080.04717.34
5.6.200.0030.05116.17
5.6.190.0080.04117.46
5.6.180.1610.02817.42
5.6.170.0130.04517.35
5.6.160.0050.02717.50
5.6.150.0050.04816.30
5.6.140.0070.04516.49
5.6.130.0060.02816.27
5.6.120.0050.02417.75
5.6.110.0020.05117.71
5.6.100.0060.03217.64
5.6.90.0020.03317.72
5.6.80.0070.02717.45
5.6.70.2320.01917.37
5.6.60.0070.00414.25
5.6.50.0030.00914.11
5.6.40.0030.00714.23
5.6.30.0130.00314.37
5.6.20.0030.01014.19
5.6.10.0040.01114.44
5.6.00.0140.00314.30
5.5.380.0060.00614.57
5.5.370.0030.01214.03
5.5.360.0040.01214.55
5.5.350.0100.02717.52
5.5.340.0090.01816.16
5.5.330.0100.04317.50
5.5.320.2050.02617.33
5.5.310.0150.02817.32
5.5.300.0060.04616.22
5.5.290.0030.04716.09
5.5.280.0030.03217.59
5.5.270.0050.02617.56
5.5.260.0080.02217.44
5.5.250.0100.04517.38
5.5.240.0070.02217.35
5.5.230.0030.00714.04
5.5.220.0100.00314.05
5.5.210.0120.00314.15
5.5.200.0000.01414.05
5.5.190.0030.01314.29
5.5.180.0000.01014.30
5.5.170.0090.00314.21
5.5.160.0030.00914.27
5.5.150.0100.00714.04
5.5.140.0030.00714.48
5.5.130.0030.00714.39
5.5.120.0070.01014.25
5.5.110.0000.01114.06
5.5.100.0030.01414.09
5.5.90.0070.01013.93
5.5.80.0090.00614.22
5.5.70.0030.00714.14
5.5.60.0040.01114.21
5.5.50.0000.01514.39
5.5.40.0030.00814.41
5.5.30.0000.01414.16
5.5.20.0050.00514.28
5.5.10.0100.00714.43
5.5.00.0070.00714.17
5.4.450.0250.02720.43
5.4.440.0150.02920.48
5.4.430.0100.03020.49
5.4.420.0080.02420.71
5.4.410.0290.01820.62
5.4.400.0150.02220.03
5.4.390.0120.02419.84
5.4.380.0070.03314.90
5.4.370.0150.02814.98
5.4.360.0080.03114.88
5.4.350.0060.03514.76
5.4.340.0030.03314.95
5.4.330.0000.01011.16
5.4.320.0070.01911.77
5.4.310.0080.02511.81
5.4.300.0050.02011.80
5.4.290.0060.02311.83
5.4.280.0020.02511.67
5.4.270.0050.02111.86
5.4.260.0060.02311.83
5.4.250.0020.02911.67
5.4.240.0060.02311.76
5.4.230.0050.02311.70
5.4.220.0070.02211.70
5.4.210.0070.02611.79
5.4.200.0060.02311.59
5.4.190.0060.02511.59
5.4.180.0070.02611.86
5.4.170.0040.02511.75
5.4.160.0080.02211.64
5.4.150.0080.02511.79
5.4.140.0090.02411.71
5.4.130.0020.03111.73
5.4.120.0090.02811.58
5.4.110.0090.02611.68
5.4.100.0080.02611.65
5.4.90.0040.03211.63
5.4.80.0040.03211.60
5.4.70.0060.02911.52
5.4.60.0060.02611.61
5.4.50.0080.02611.58
5.4.40.0040.03311.53
5.4.30.0070.02611.61
5.4.20.0060.02811.65
5.4.10.0110.02211.45
5.4.00.0050.03011.12
5.3.290.0040.02611.78
5.3.280.0090.02411.56
5.3.270.0050.02411.72
5.3.260.0020.02611.76
5.3.250.0050.02611.73
5.3.240.0030.02311.49
5.3.230.0050.02311.52
5.3.220.0050.02311.52
5.3.210.0050.02211.61
5.3.200.0070.02311.47
5.3.190.0040.03011.60
5.3.180.0060.02711.74
5.3.170.0060.02311.59
5.3.160.0090.01911.71
5.3.150.0040.02511.57
5.3.140.0050.02111.66
5.3.130.0060.02411.70
5.3.120.0090.02511.64
5.3.110.0070.02211.65
5.3.100.0050.02311.31
5.3.90.0070.02011.42
5.3.80.0060.02311.33
5.3.70.0060.02311.35
5.3.60.0070.02611.36
5.3.50.0090.02111.35
5.3.40.0060.02811.30
5.3.30.0040.02711.33
5.3.20.0080.02211.18
5.3.10.0050.02311.07
5.3.00.0080.02311.08
5.2.170.0100.0359.23
5.2.160.0070.0379.23
5.2.150.0060.0339.23
5.2.140.0050.0319.23
5.2.130.0070.0299.19
5.2.120.0060.0299.19
5.2.110.0070.0329.19
5.2.100.0050.0299.19
5.2.90.0060.0309.18
5.2.80.0060.0329.18
5.2.70.0070.0349.18
5.2.60.0090.0339.14
5.2.50.0100.0269.11
5.2.40.0060.0299.08
5.2.30.0050.0339.05
5.2.20.0040.0339.04
5.2.10.0040.0338.95
5.2.00.0050.0328.81
5.1.60.0040.0288.09
5.1.50.0110.0218.09
5.1.40.0030.0298.08
5.1.30.0050.0318.43
5.1.20.0060.0278.45
5.1.10.0040.0278.17
5.1.00.0030.0388.17
5.0.50.0050.0296.65
5.0.40.0040.0296.51
5.0.30.0050.0316.32
5.0.20.0030.0216.29
5.0.10.0050.0256.27
5.0.00.0100.0256.26
4.4.90.0020.0174.78
4.4.80.0030.0164.75
4.4.70.0030.0174.75
4.4.60.0020.0184.75
4.4.50.0060.0164.77
4.4.40.0030.0284.70
4.4.30.0040.0174.76
4.4.20.0020.0244.84
4.4.10.0070.0174.85
4.4.00.0030.0304.76
4.3.110.0030.0194.67
4.3.100.0040.0174.66
4.3.90.0050.0164.63
4.3.80.0020.0354.58
4.3.70.0050.0234.63
4.3.60.0060.0154.62
4.3.50.0030.0244.63
4.3.40.0040.0334.54
4.3.30.0040.0223.32
4.3.20.0050.0193.29
4.3.10.0020.0223.25
4.3.00.0170.01728.29

preferences:
31.52 ms | 401 KiB | 5 Q