3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pack_encode($format, $val) { $b64 = base64_encode(pack($format, $val)); return str_replace(array('/', '='), array('_', ''), $b64); } function pack_decode($format, $val) { $b64 = str_replace('_', '/', $val); // un-padded return unpack($format, base64_decode($b64, false)); } function pack_encode_uint16($val) { return pack_encode('S', $val); } function pack_encode_uint32($val) { return pack_encode('N', $val); } function pack_decode_uint16($val) { return pack_decode('S', $val); } function pack_decode_uint32($val) { return pack_decode('N', $val); } $max = 32767; $n = 20; $step = intval($max/$n); for ($i=0; $i<=$n; $i++) { $val = $i*$step; $uint16 = pack_encode_uint16($val); $uint32 = pack_encode_uint32($val); $str = base64_encode(strval($val)); echo "$uint16 $uint32 $str $val\n"; }

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)
8.3.60.0090.00918.43
8.3.50.0060.01322.90
8.3.40.0000.01418.79
8.3.30.0030.01019.00
8.3.20.0070.00020.34
8.3.10.0030.00521.90
8.3.00.0040.00417.50
8.2.180.0150.00616.38
8.2.170.0110.00422.96
8.2.160.0070.00720.53
8.2.150.0000.00724.18
8.2.140.0000.00724.66
8.2.130.0150.00626.16
8.2.120.0080.00020.84
8.2.110.0060.00322.01
8.2.100.0050.00518.03
8.2.90.0000.00819.17
8.2.80.0050.00317.97
8.2.70.0030.00517.63
8.2.60.0070.00017.80
8.2.50.0030.00618.07
8.2.40.0040.00718.03
8.2.30.0050.00218.13
8.2.20.0040.00417.71
8.2.10.0030.00518.07
8.2.00.0000.00717.70
8.1.280.0090.01225.92
8.1.270.0030.00623.87
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00023.96
8.1.230.0000.01119.16
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0060.00318.49
8.1.160.0040.00422.01
8.1.150.0040.00418.84
8.1.140.0040.00417.38
8.1.130.0000.00817.84
8.1.120.0040.00417.30
8.1.110.0080.00017.32
8.1.100.0000.00717.43
8.1.90.0040.00417.48
8.1.80.0070.00017.42
8.1.70.0030.00617.44
8.1.60.0000.01017.59
8.1.50.0050.00317.55
8.1.40.0040.00417.46
8.1.30.0030.00617.73
8.1.20.0040.00417.61
8.1.10.0040.00417.41
8.1.00.0040.00417.47
8.0.300.0040.00418.77
8.0.290.0070.00016.72
8.0.280.0000.00718.42
8.0.270.0030.00617.19
8.0.260.0030.00317.28
8.0.250.0030.00317.01
8.0.240.0000.00617.01
8.0.230.0000.00716.97
8.0.220.0030.00316.91
8.0.210.0000.00716.82
8.0.200.0000.00816.99
8.0.190.0030.00516.97
8.0.180.0040.00416.96
8.0.170.0030.00516.84
8.0.160.0080.00016.94
8.0.150.0030.00516.82
8.0.140.0040.00416.78
8.0.130.0030.00313.30
8.0.120.0000.00816.78
8.0.110.0040.00416.91
8.0.100.0040.00416.75
8.0.90.0000.00816.80
8.0.80.0070.01016.97
8.0.70.0000.00816.79
8.0.60.0070.00016.95
8.0.50.0040.00416.88
8.0.30.0100.01217.05
8.0.20.0130.00617.40
8.0.10.0040.00417.10
8.0.00.0120.00716.83
7.4.330.0030.00315.00
7.4.320.0060.00016.65
7.4.300.0030.00316.61
7.4.290.0040.00416.61
7.4.280.0050.00216.64
7.4.270.0030.00316.54
7.4.260.0070.00016.58
7.4.250.0000.00716.59
7.4.240.0010.00616.57
7.4.230.0040.00416.52
7.4.220.0140.00416.70
7.4.210.0120.00616.58
7.4.200.0070.00016.69
7.4.160.0170.00316.43
7.4.150.0170.00717.40
7.4.140.0070.01517.86
7.4.130.0040.01216.63
7.4.120.0080.00816.42
7.4.110.0070.01016.55
7.4.100.0060.01016.42
7.4.90.0120.00616.67
7.4.80.0090.01219.39
7.4.70.0080.00816.57
7.4.60.0090.00916.44
7.4.50.0000.00616.45
7.4.40.0070.01016.54
7.4.30.0060.01116.51
7.4.00.0070.01114.98
7.3.330.0030.00313.35
7.3.320.0000.00513.23
7.3.310.0000.00716.30
7.3.300.0040.00416.39
7.3.290.0070.00716.40
7.3.280.0100.00816.36
7.3.270.0130.00317.40
7.3.260.0100.00716.51
7.3.250.0110.00916.43
7.3.240.0060.01216.61
7.3.230.0040.01516.55
7.3.210.0030.01416.46
7.3.200.0060.01519.39
7.3.190.0160.00716.67
7.3.180.0140.00416.27
7.3.170.0090.00816.36
7.3.160.0060.01116.56
7.3.10.0120.00316.55
7.3.00.0140.00316.47
7.2.330.0070.01016.84
7.2.320.0030.01416.75
7.2.310.0090.00916.70
7.2.300.0090.00816.44
7.2.290.0110.01116.78
7.2.130.0030.01316.85
7.2.120.0060.00916.75
7.2.110.0000.01716.77
7.2.100.0000.01616.88
7.2.90.0030.01017.09
7.2.80.0090.00617.00
7.2.70.0060.00616.98
7.2.60.0030.01016.62
7.2.50.0100.00317.01
7.2.40.0060.00616.74
7.2.30.0120.00316.82
7.2.20.0110.00316.83
7.2.10.0080.00416.68
7.2.00.0030.01016.89
7.1.250.0040.01115.65
7.1.70.0060.00317.00
7.1.60.0090.01519.40
7.1.50.0040.01816.68
7.1.00.0070.07022.38
7.0.200.0050.00316.73
7.0.140.0070.06322.01
7.0.60.0100.05319.84
7.0.50.0100.07717.86
7.0.40.0000.04720.30
7.0.30.0470.07320.15
7.0.20.0330.07020.33
7.0.10.0000.05020.21
7.0.00.0100.05720.05
5.6.280.0070.07021.11
5.6.210.0070.08020.64
5.6.200.0070.04018.19
5.6.190.0000.09020.63
5.6.180.0300.07320.57
5.6.170.0230.04320.55
5.6.160.0100.08020.55
5.6.150.0100.08318.16
5.6.140.0100.07318.18
5.6.130.0000.07318.21
5.6.120.0170.07321.00
5.6.110.0100.07721.00
5.6.100.0070.06721.12
5.6.90.0030.06321.02
5.6.80.0000.08320.52
5.5.350.4200.04020.38
5.5.340.0130.07017.93
5.5.330.0170.07020.38
5.5.320.0330.08020.31
5.5.310.0270.04720.29
5.5.300.0100.06317.98
5.5.290.0030.05318.09
5.5.280.0000.06320.86
5.5.270.0070.08320.97
5.5.260.0000.09320.78
5.5.250.0170.08020.56
5.5.240.0230.07320.08
5.4.450.0570.05019.50
5.4.440.0830.02719.33
5.4.430.0370.03319.45
5.4.420.0200.04319.63
5.4.410.0430.03719.29
5.4.400.0270.03319.10
5.4.390.0230.03719.00
5.4.380.0230.06018.58
5.4.370.0370.04718.76
5.4.360.0400.05018.77
5.4.350.0470.06018.86
5.4.340.0430.04718.73
5.4.320.0040.03812.52
5.4.310.0080.03612.51
5.4.300.0050.03812.52
5.4.290.0080.03712.51
5.4.280.0080.03412.41
5.4.270.0060.03612.41
5.4.260.0080.03512.41
5.4.250.0080.03612.41
5.4.240.0080.03512.41
5.4.230.0070.03712.40
5.4.220.0040.03912.40
5.4.210.0050.03712.40
5.4.200.0080.03712.40
5.4.190.0050.05412.40
5.4.180.0030.05612.40
5.4.170.0050.03812.41
5.4.160.0050.03512.40
5.4.150.0060.03712.40
5.4.140.0050.03812.08
5.4.130.0060.03512.07
5.4.120.0030.03812.04
5.4.110.0100.03312.02
5.4.100.0060.03512.03
5.4.90.0080.04212.03
5.4.80.0050.03812.02
5.4.70.0050.03612.03
5.4.60.0040.03812.02
5.4.50.0040.03812.02
5.4.40.0060.03512.01
5.4.30.0080.03912.01
5.4.20.0060.03512.01
5.4.10.0060.03412.00
5.4.00.0060.03611.48
5.3.290.0060.04312.80
5.3.280.0050.03912.71
5.3.270.0030.04212.72
5.3.260.0080.03712.72
5.3.250.0040.03912.72
5.3.240.0040.03912.72
5.3.230.0060.03812.71
5.3.220.0050.03812.68
5.3.210.0050.04012.68
5.3.200.0040.03912.68
5.3.190.0040.03912.68
5.3.180.0050.03812.67
5.3.170.0080.03512.67
5.3.160.0040.03912.67
5.3.150.0100.03212.68
5.3.140.0050.03712.66
5.3.130.0050.03912.66
5.3.120.0080.03712.66
5.3.110.0050.04012.66
5.3.100.0050.03812.13
5.3.90.0070.03512.11
5.3.80.0040.03912.10
5.3.70.0070.03612.10
5.3.60.0060.03612.09
5.3.50.0070.03512.04
5.3.40.0070.03712.03
5.3.30.0080.03412.00
5.3.20.0070.03411.77
5.3.10.0060.03411.74
5.3.00.0060.03611.73
5.2.170.0050.0309.23
5.2.160.0040.0299.23
5.2.150.0080.0279.23
5.2.140.0060.0319.23
5.2.130.0030.0319.19
5.2.120.0050.0289.19
5.2.110.0040.0309.19
5.2.100.0070.0269.19
5.2.90.0050.0289.19
5.2.80.0040.0319.18
5.2.70.0040.0319.19
5.2.60.0020.0339.14
5.2.50.0050.0299.11
5.2.40.0060.0389.08
5.2.30.0030.0319.06
5.2.20.0050.0299.05
5.2.10.0040.0298.96
5.2.00.0050.0288.82
5.1.60.0070.0228.11
5.1.50.0030.0268.09
5.1.40.0040.0248.08
5.1.30.0050.0258.43
5.1.20.0020.0298.45
5.1.10.0040.0278.17
5.1.00.0020.0298.18
5.0.50.0050.0206.66
5.0.40.0010.0226.53
5.0.30.0030.0336.33
5.0.20.0030.0206.30
5.0.10.0030.0226.28
5.0.00.0020.0326.27
4.4.90.0030.0184.78
4.4.80.0020.0234.75
4.4.70.0040.0154.75
4.4.60.0040.0214.76
4.4.50.0060.0204.77
4.4.40.0020.0274.71
4.4.30.0050.0154.76
4.4.20.0040.0154.85
4.4.10.0020.0174.85
4.4.00.0030.0254.76
4.3.110.0040.0154.67
4.3.100.0030.0154.66
4.3.90.0050.0164.63
4.3.80.0020.0274.58
4.3.70.0020.0224.63
4.3.60.0030.0204.62
4.3.50.0000.0204.63
4.3.40.0020.0264.54
4.3.30.0030.0223.32
4.3.20.0010.0173.30
4.3.10.0020.0163.26
4.3.00.0030.01715.90

preferences:
51.72 ms | 401 KiB | 5 Q