3v4l.org

run code in 300+ PHP versions simultaneously
<?php mt_srand(42); // make output determinstic on versions of php without openssl_random_pseudo_bytes for testing purposes for ($i = 0; $i < 10; $i++) { echo generate_key($i + 40) . "\n"; } function generate_key($length) { $key = base64_urlencode(random_bytes(ceil($length * 0.75))); if (strlen($key) > $length) { $key = substr($key, 0, $length); } return $key; } function base64_urlencode($data) { return str_replace( array('+', '/', '='), array('-', '_', ''), base64_encode($data) ); } function random_bytes($length) { if (function_exists("openssl_random_pseudo_bytes")) { return openssl_random_pseudo_bytes($length); } $data = ""; for ($i = 0; $i < $length; $i++) { $data .= chr(mt_rand(0, 255)); } return $data; }

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)
5.6.210.0030.08320.55
5.6.200.0100.08318.23
5.6.190.0070.05320.50
5.6.180.0070.05720.46
5.6.170.0270.04020.43
5.6.160.0130.07720.75
5.6.150.0130.06318.17
5.6.140.0100.07318.25
5.6.130.0070.08018.21
5.6.120.0070.08020.98
5.6.110.0070.07321.11
5.6.100.0100.07721.14
5.6.90.0130.08320.89
5.6.80.0100.06020.45
5.6.70.4600.04020.45
5.5.350.0300.07320.40
5.5.340.0100.03718.15
5.5.330.0070.06320.33
5.5.320.0270.06720.41
5.5.310.0400.04320.48
5.5.300.0070.08018.04
5.5.290.0100.05318.08
5.5.280.0100.05020.81
5.5.270.0030.07020.69
5.5.260.0000.04720.93
5.5.250.0070.08020.50
5.5.240.0230.08020.16
5.4.450.0200.04029.93
5.4.440.0230.04729.93
5.4.430.0430.03729.93
5.4.420.0430.04029.93
5.4.410.0330.03729.93
5.4.400.1170.05319.07
5.4.390.0130.05729.34
5.4.380.0070.06318.63
5.4.370.0070.06018.84
5.4.360.0230.04318.73
5.4.350.0200.04718.80
5.4.340.0100.06018.64
5.4.320.0060.03812.51
5.4.310.0050.03812.50
5.4.300.0050.03912.51
5.4.290.0070.03712.50
5.4.280.0030.03912.40
5.4.270.0080.03512.40
5.4.260.0040.04112.40
5.4.250.0060.03912.41
5.4.240.0070.03612.40
5.4.230.0100.03412.39
5.4.220.0080.03512.39
5.4.210.0060.04112.40
5.4.200.0080.03612.39
5.4.190.0060.03612.39
5.4.180.0060.03612.39
5.4.170.0060.03612.39
5.4.160.0070.03412.39
5.4.150.0060.03612.39
5.4.140.0090.03512.07
5.4.130.0050.04012.06
5.4.120.0060.03612.02
5.4.110.0030.03812.02
5.4.100.0060.03512.02
5.4.90.0050.04812.02
5.4.80.0100.03312.02
5.4.70.0080.03312.01
5.4.60.0060.03512.02
5.4.50.0040.03812.01
5.4.40.0040.03712.00
5.4.30.0040.04012.00
5.4.20.0040.03712.00
5.4.10.0040.03612.00
5.4.00.0070.03611.48
5.3.290.0080.03712.80
5.3.280.0090.03612.71
5.3.270.0060.03912.72
5.3.260.0090.03712.72
5.3.250.0070.03612.72
5.3.240.0080.03912.72
5.3.230.0050.04012.71
5.3.220.0050.04012.68
5.3.210.0070.04112.68
5.3.200.0070.03712.68
5.3.190.0060.03812.67
5.3.180.0080.03712.68
5.3.170.0100.03412.67
5.3.160.0070.04012.67
5.3.150.0050.03912.67
5.3.140.0080.03412.66
5.3.130.0080.03712.65
5.3.120.0100.04112.66
5.3.110.0100.05212.65
5.3.100.0080.03712.13
5.3.90.0060.04612.11
5.3.80.0060.04112.10
5.3.70.0050.03712.10
5.3.60.0040.03812.08
5.3.50.0100.03512.03
5.3.40.0070.03912.04
5.3.30.0040.03711.99
5.3.20.0070.03411.78
5.3.10.0050.03511.73
5.3.00.0120.03011.73
5.2.170.0050.0339.23
5.2.160.0050.0329.23
5.2.150.0150.0239.23
5.2.140.0080.0299.23
5.2.130.0010.0359.19
5.2.120.0060.0289.19
5.2.110.0080.0269.19
5.2.100.0070.0269.19
5.2.90.0010.0339.19
5.2.80.0050.0319.18
5.2.70.0060.0299.18
5.2.60.0040.0309.14
5.2.50.0020.0339.11
5.2.40.0060.0279.09
5.2.30.0060.0339.06
5.2.20.0090.0279.04
5.2.10.0040.0348.95
5.2.00.0070.0358.82
5.1.60.0060.0248.10
5.1.50.0050.0298.09
5.1.40.0050.0238.07
5.1.30.0060.0248.42
5.1.20.0040.0268.45
5.1.10.0060.0298.17
5.1.00.0040.0308.17
5.0.50.0050.0196.65
5.0.40.0040.0246.51
5.0.30.0040.0316.32
5.0.20.0060.0226.31
5.0.10.0010.0246.29
5.0.00.0030.0326.28
4.4.90.0030.0164.78
4.4.80.0060.0164.76
4.4.70.0030.0164.75
4.4.60.0040.0154.76
4.4.50.0060.0134.77
4.4.40.0040.0274.71
4.4.30.0030.0164.76
4.4.20.0040.0174.85
4.4.10.0050.0144.84
4.4.00.0040.0324.76
4.3.110.0040.0214.67
4.3.100.0050.0204.66
4.3.90.0080.0164.63
4.3.80.0040.0264.58
4.3.70.0020.0164.63
4.3.60.0040.0214.63
4.3.50.0040.0214.63
4.3.40.0030.0254.54
4.3.30.0030.0223.34
4.3.20.0040.0173.32
4.3.10.0020.0213.27
4.3.00.0200.01728.52

preferences:
140.98 ms | 1394 KiB | 7 Q