3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(42); 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.00.0060.01314.71
7.3.120.0050.00914.74
7.3.110.0090.00714.96
7.3.100.0100.00715.00
7.3.90.0080.01014.88
7.3.80.0090.00714.78
7.3.70.0080.01014.84
7.3.60.0140.00214.86
7.3.50.0080.00814.84
7.3.40.0080.00614.78
7.3.30.0070.00614.75
7.3.20.0070.01016.59
7.3.10.0060.00916.70
7.3.00.0050.01016.36
7.2.250.0110.00715.03
7.2.240.0100.00815.14
7.2.230.0030.01215.12
7.2.220.0070.00914.96
7.2.210.0050.01115.07
7.2.200.0090.00915.13
7.2.190.0060.01015.05
7.2.180.0060.01015.11
7.2.170.0040.01115.01
7.2.160.0090.00615.19
7.2.150.0000.01417.02
7.2.140.0030.01416.66
7.2.130.0070.00916.88
7.2.120.0070.00816.97
7.2.110.0050.00716.97
7.2.100.0050.00716.89
7.2.90.0040.00916.98
7.2.80.0060.00616.91
7.2.70.0050.01217.06
7.2.60.0080.00617.04
7.2.50.0050.01216.91
7.2.40.0060.00816.74
7.2.30.0020.01316.84
7.2.20.0030.01216.98
7.2.10.0100.00717.06
7.2.00.0100.00617.70
7.1.330.0050.00815.84
7.1.320.0050.00915.93
7.1.310.0120.00315.75
7.1.300.0050.00915.81
7.1.290.0060.00615.89
7.1.280.0050.00915.73
7.1.270.0040.00915.78
7.1.260.0050.01015.66
7.1.250.0070.00415.69
7.1.70.0000.00717.28
7.1.60.0100.01419.70
7.1.50.0030.01017.03
7.1.00.0070.07022.48
7.0.200.0040.00416.52
7.0.140.0000.07722.01
7.0.60.0130.05019.83
7.0.50.0070.05717.96
7.0.40.0070.04320.24
7.0.30.0230.03720.07
7.0.20.0270.08020.20
7.0.10.0130.08020.19
7.0.00.0100.08020.09
5.6.280.0030.07721.00
5.6.210.0030.07720.75
5.6.200.0070.04718.15
5.6.190.0070.04720.49
5.6.180.3070.04720.77
5.6.170.0130.04720.71
5.6.160.0030.08320.63
5.6.150.0070.03718.15
5.6.140.0070.08318.26
5.6.130.0070.08318.11
5.6.120.0100.03721.01
5.6.110.0000.07321.12
5.6.100.0130.07020.89
5.6.90.0070.04721.13
5.6.80.0100.03320.41
5.5.350.0230.07320.50
5.5.340.0130.06317.94
5.5.330.0070.08720.35
5.5.320.3770.04020.27
5.5.310.0370.07020.27
5.5.300.0030.05018.08
5.5.290.0070.05318.01
5.5.280.0130.04020.75
5.5.270.0100.07320.73
5.5.260.0030.09020.80
5.5.250.0070.03720.79
5.5.240.3030.03320.29
5.4.450.0330.04729.93
5.4.440.0500.05029.93
5.4.430.0370.04029.93
5.4.420.0300.03729.93
5.4.410.0230.05029.92
5.4.400.0230.04029.48
5.4.390.0970.03719.09
5.4.380.0170.05318.58
5.4.370.0100.05718.62
5.4.360.0200.05018.48
5.4.350.0230.04718.57
5.4.340.0200.04718.58
5.4.320.0040.03812.51
5.4.310.0070.04012.51
5.4.300.0060.04112.51
5.4.290.0040.04112.50
5.4.280.0090.03512.40
5.4.270.0080.04112.40
5.4.260.0090.04112.40
5.4.250.0080.04012.40
5.4.240.0070.03912.40
5.4.230.0050.04412.40
5.4.220.0070.04312.39
5.4.210.0070.03912.39
5.4.200.0090.03912.39
5.4.190.0060.03912.39
5.4.180.0070.03912.39
5.4.170.0070.04412.40
5.4.160.0100.04212.40
5.4.150.0130.04012.39
5.4.140.0100.04412.07
5.4.130.0100.04012.06
5.4.120.0060.04412.02
5.4.110.0080.03512.02
5.4.100.0070.03612.01
5.4.90.0060.03912.02
5.4.80.0060.03912.02
5.4.70.0030.04012.02
5.4.60.0060.03912.02
5.4.50.0050.03912.02
5.4.40.0060.03712.00
5.4.30.0080.03712.00
5.4.20.0090.04212.00
5.4.10.0060.03612.00
5.4.00.0040.04011.49
5.3.290.0090.03712.80
5.3.280.0070.04412.71
5.3.270.0060.04312.72
5.3.260.0090.04712.72
5.3.250.0080.04912.72
5.3.240.0100.05012.72
5.3.230.0070.05112.71
5.3.220.0120.04712.68
5.3.210.0080.04712.68
5.3.200.0070.04212.68
5.3.190.0060.05112.68
5.3.180.0140.04412.68
5.3.170.0140.04512.67
5.3.160.0100.04412.67
5.3.150.0100.05212.67
5.3.140.0090.05712.66
5.3.130.0080.04712.66
5.3.120.0080.04312.66
5.3.110.0110.04512.66
5.3.100.0090.04812.13
5.3.90.0090.04412.13
5.3.80.0090.04112.10
5.3.70.0120.03612.10
5.3.60.0060.04112.09
5.3.50.0070.04112.03
5.3.40.0090.03912.03
5.3.30.0080.04211.99
5.3.20.0090.04511.78
5.3.10.0070.04411.74
5.3.00.0090.04111.72
5.2.170.0040.0329.23
5.2.160.0070.0279.23
5.2.150.0040.0329.23
5.2.140.0060.0399.23
5.2.130.0030.0369.19
5.2.120.0080.0319.19
5.2.110.0050.0339.19
5.2.100.0070.0339.19
5.2.90.0050.0419.18
5.2.80.0060.0399.18
5.2.70.0100.0379.18
5.2.60.0080.0409.14
5.2.50.0070.0399.11
5.2.40.0030.0389.08
5.2.30.0060.0429.05
5.2.20.0050.0389.04
5.2.10.0100.0318.95
5.2.00.0100.0318.82
5.1.60.0030.0318.10
5.1.50.0040.0318.09
5.1.40.0030.0318.08
5.1.30.0100.0328.43
5.1.20.0180.0658.45
5.1.10.0070.0618.17
5.1.00.0060.0418.17
5.0.50.0040.0316.65
5.0.40.0100.0556.50
5.0.30.0120.0506.32
5.0.20.0110.0466.29
5.0.10.0040.0286.27
5.0.00.0020.0386.26
4.4.90.0050.0174.77
4.4.80.0050.0204.75
4.4.70.0110.0224.76
4.4.60.0040.0314.75
4.4.50.0050.0214.77
4.4.40.0040.0314.70
4.4.30.0150.0704.75
4.4.20.0030.0234.84
4.4.10.0060.0154.85
4.4.00.0020.0294.75
4.3.110.0050.0164.66
4.3.100.0120.0624.66
4.3.90.0050.0314.63
4.3.80.0110.0544.59
4.3.70.0040.0164.63
4.3.60.0020.0194.63
4.3.50.0030.0194.63
4.3.40.0050.0244.54
4.3.30.0050.0163.32
4.3.20.0030.0173.29
4.3.10.0030.0163.25
4.3.00.0230.03028.29

preferences:
41.6 ms | 401 KiB | 5 Q