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(49); 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.0090.00914.80
7.4.00.0060.01314.87
7.3.130.0110.01114.87
7.3.120.0070.01114.69
7.3.110.0020.01714.87
7.3.100.0060.00914.86
7.3.90.0040.01115.04
7.3.80.0050.00914.99
7.3.70.0060.00714.81
7.3.60.0090.00714.84
7.3.50.0070.00714.95
7.3.40.0030.01014.63
7.3.30.0030.01014.69
7.3.20.0050.00716.66
7.3.10.0110.00516.71
7.3.00.0050.01116.79
7.2.260.0090.00915.19
7.2.250.0090.01015.04
7.2.240.0070.01115.12
7.2.230.0050.01014.97
7.2.220.0090.00915.07
7.2.210.0040.01115.04
7.2.200.0070.01014.98
7.2.190.0090.00715.03
7.2.180.0030.01015.15
7.2.170.0070.00915.09
7.2.160.0060.00615.09
7.2.150.0060.00617.00
7.2.140.0110.00416.89
7.2.130.0090.01216.97
7.2.120.0000.01816.98
7.2.110.0140.01116.73
7.2.100.0060.01216.57
7.2.90.0040.01116.95
7.2.80.0030.01016.99
7.2.70.0040.01517.04
7.2.60.0110.00416.99
7.2.50.0040.01117.01
7.2.40.0070.00317.11
7.2.30.0030.01317.10
7.2.20.0100.00716.74
7.2.10.0130.00316.95
7.2.00.0020.01218.23
7.1.330.0060.00815.79
7.1.320.0070.00715.70
7.1.310.0000.01615.67
7.1.300.0030.01015.76
7.1.290.0050.00715.83
7.1.280.0050.00915.68
7.1.270.0090.00715.84
7.1.260.0060.00615.79
7.1.250.0110.00915.64
7.1.240.0040.00815.51
7.1.230.0040.00915.74
7.1.220.0040.01115.78
7.1.210.0030.00915.63
7.1.200.0040.01115.88
7.1.190.0090.00315.87
7.1.180.0060.00615.75
7.1.170.0040.01215.61
7.1.160.0080.00415.87
7.1.150.0030.00715.98
7.1.140.0070.01015.75
7.1.130.0070.01115.76
7.1.120.0080.00815.79
7.1.110.0040.00715.78
7.1.100.0090.00315.77
7.1.90.0060.00915.85
7.1.80.0030.01015.59
7.1.70.0020.01116.48
7.1.60.0110.00617.76
7.1.50.0050.00816.43
7.1.40.0060.00915.84
7.1.30.0070.00715.56
7.1.20.0060.00615.82
7.1.10.0090.00615.79
7.1.00.0030.04518.97
7.0.330.0080.00315.50
7.0.320.0100.00715.62
7.0.310.0110.00715.14
7.0.300.0070.00315.26
7.0.290.0040.00715.24
7.0.280.0080.00015.61
7.0.270.0120.00415.45
7.0.260.0140.00315.39
7.0.250.0040.00415.64
7.0.240.0100.00315.64
7.0.230.0080.00615.43
7.0.220.0040.01115.33
7.0.210.0040.01115.29
7.0.200.0050.00716.13
7.0.190.0040.01115.52
7.0.180.0030.01015.59
7.0.170.0060.00615.20
7.0.160.0060.00915.12
7.0.150.0090.00315.44
7.0.140.0070.03718.63
7.0.130.0100.00315.55
7.0.120.0100.00615.48
7.0.110.0050.03717.77
7.0.100.0100.03517.75
7.0.90.0070.03717.68
7.0.80.0080.02317.63
7.0.70.0020.04717.84
7.0.60.0060.04517.65
7.0.50.0080.04617.75
7.0.40.0070.04616.73
7.0.30.0030.03816.60
7.0.20.0070.04416.68
7.0.10.0050.02916.51
7.0.00.0070.04416.56
5.6.400.0100.00614.46
5.6.390.0090.00614.49
5.6.380.0030.00614.63
5.6.370.0050.00514.30
5.6.360.0060.00614.18
5.6.350.0070.01014.69
5.6.340.0030.00914.67
5.6.330.0000.00914.63
5.6.320.0000.01414.30
5.6.310.0040.01114.67
5.6.300.0070.00414.28
5.6.290.0070.00714.51
5.6.280.0060.03817.79
5.6.270.0030.01414.42
5.6.260.0020.05017.71
5.6.250.0050.04717.42
5.6.240.0070.04217.61
5.6.230.0150.03817.54
5.6.220.0090.03017.47
5.6.210.0110.02317.66
5.6.200.0050.04717.56
5.6.190.0080.04217.55
5.6.180.0080.02617.44
5.6.170.0100.04117.43
5.6.160.0070.02817.67
5.6.150.0020.04117.47
5.6.140.0070.04317.30
5.6.130.0050.03017.43
5.6.120.0030.04917.31
5.6.110.0090.04417.43
5.6.100.0060.04017.62
5.6.90.0100.04217.46
5.6.80.0030.04617.28
5.6.70.0080.04317.15
5.6.60.0080.02217.14
5.6.50.0140.03517.14
5.6.40.0060.04517.22
5.6.30.0080.04117.17
5.6.20.0050.04417.28
5.6.10.0070.04517.15
5.6.00.0040.04117.15
5.5.380.0070.04117.37
5.5.370.0070.04417.34
5.5.360.0030.04517.10
5.5.350.0080.04417.19
5.5.340.0110.04017.56
5.5.330.0100.04217.67
5.5.320.0050.03517.53
5.5.310.0080.04217.53
5.5.300.0080.04517.73
5.5.290.0080.04617.58
5.5.280.0120.03717.47
5.5.270.0050.04317.70
5.5.260.0070.04317.69
5.5.250.0000.04317.43
5.5.240.0050.04117.26
5.5.230.0080.04117.35
5.5.220.0050.04317.16
5.5.210.0100.04217.35
5.5.200.0060.04417.39
5.5.190.0140.03317.24
5.5.180.0020.03517.24
5.5.170.0030.01314.43
5.5.160.0100.04217.32
5.5.150.0060.02517.39
5.5.140.0070.04217.17
5.5.130.0150.03317.27
5.5.120.0090.04317.36
5.5.110.0050.04817.19
5.5.100.0090.03717.24
5.5.90.0130.03517.28
5.5.80.0060.02816.91
5.5.70.0020.03217.05
5.5.60.0030.03116.92
5.5.50.0020.04317.17
5.5.40.0060.04117.28
5.5.30.0080.04017.16
5.5.20.0040.04617.14
5.5.10.0070.04217.08
5.5.00.0090.04417.06
5.4.450.0030.05016.09
5.4.440.0050.02716.05
5.4.430.0080.03516.02
5.4.420.0030.04316.06
5.4.410.0030.03215.94
5.4.400.0050.04015.95
5.4.390.0020.03915.84
5.4.380.0030.04615.95
5.4.370.0100.03915.95
5.4.360.0030.03116.01
5.4.350.0080.03815.89
5.4.340.0060.04316.02
5.4.330.0000.01112.71
5.4.320.0070.03915.97
5.4.310.0050.02515.86
5.4.300.0050.03415.93
5.4.290.0050.02715.87
5.4.280.0050.03715.86
5.4.270.0080.03615.83
5.4.260.0030.03815.91
5.4.250.0070.04315.96
5.4.240.0050.04015.86
5.4.230.0050.04115.90
5.4.220.0000.04615.94
5.4.210.0050.04215.94
5.4.200.0100.03515.90
5.4.190.0050.03815.82
5.4.180.0070.04215.97
5.4.170.0080.03715.96
5.4.160.0050.03515.85
5.4.150.0080.04115.86
5.4.140.0100.03614.59
5.4.130.0070.04014.62
5.4.120.0070.04014.64
5.4.110.0060.02614.56
5.4.100.0070.03714.63
5.4.90.0070.02514.56
5.4.80.0050.04214.66
5.4.70.0070.04214.63
5.4.60.0060.03614.61
5.4.50.0030.03914.57
5.4.40.0050.04614.61
5.4.30.0030.04014.52
5.4.20.0040.03714.57
5.4.10.0050.03014.57
5.4.00.0040.04114.24
5.3.290.0090.04013.76
5.3.280.0080.03813.65
5.3.270.0060.04113.78
5.3.260.0070.02613.66
5.3.250.0060.04113.66
5.3.240.0070.04013.59
5.3.230.0080.02313.72
5.3.220.0030.02713.66
5.3.210.0100.03513.71
5.3.200.0030.04113.62
5.3.190.0070.04313.71
5.3.180.0100.03713.65
5.3.170.0070.02213.64
5.3.160.0090.03513.65
5.3.150.0050.04013.64
5.3.140.0010.04113.63
5.3.130.0030.04413.62
5.3.120.0100.03213.64
5.3.110.0060.04113.64
5.3.100.0140.03213.49
5.3.90.0080.04013.38
5.3.80.0050.02513.48
5.3.70.0050.02913.37
5.3.60.0080.03413.29
5.3.50.0080.04013.37
5.3.40.0050.04113.40
5.3.30.0080.03513.24
5.3.20.0060.03613.21
5.3.10.0030.03813.19
5.3.00.0050.04113.18
5.2.170.0030.06312.07
5.2.160.0000.06712.07
5.2.150.0070.06712.07
5.2.140.0070.06012.07
5.2.130.0070.06012.07
5.2.120.0170.04712.07
5.2.110.0070.06012.07
5.2.100.0170.04712.07
5.2.90.0170.05012.07
5.2.80.0070.06312.07
5.2.70.0070.06312.07
5.2.60.0100.05312.07
5.2.50.0070.06012.07
5.2.40.0030.05712.07
5.2.30.0030.05712.07
5.2.20.0100.05712.07
5.2.10.0070.06012.07
5.2.00.0030.06312.07
5.1.60.0030.04312.07
5.1.50.0100.03712.07
5.1.40.0070.05012.07
5.1.30.0030.03712.07
5.1.20.0070.05312.07
5.1.10.0100.05312.07
5.1.00.0000.06312.07
5.0.50.0000.04712.07
5.0.40.0070.03712.07
5.0.30.0030.06712.07
5.0.20.0000.04712.07
5.0.10.0070.04012.07
5.0.00.0000.06712.07
4.4.90.0000.04012.07
4.4.80.0030.03712.07
4.4.70.0000.02712.07
4.4.60.0000.02712.07
4.4.50.0070.03312.07
4.4.40.0030.05312.07
4.4.30.0100.03012.07
4.4.20.0000.03712.07
4.4.10.0000.02712.07
4.4.00.0100.04712.07
4.3.110.0100.03012.07
4.3.100.0030.03712.07
4.3.90.0000.03712.07
4.3.80.0030.04712.07
4.3.70.0000.04012.07
4.3.60.0030.03712.07
4.3.50.0100.03012.07
4.3.40.0000.05012.07
4.3.30.0030.03312.07
4.3.20.0000.04012.07
4.3.10.0000.03312.07
4.3.00.0000.03712.07

preferences:
38.29 ms | 401 KiB | 5 Q