3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = '2001:db8::567:89ab'; $parts = explode(':', $address); $len = count($parts); if ($len < 8) { if ($parts[0] === '') { array_splice($parts, 1, 0, array_fill(0, 8 - $len, 0)); $parts = array_reverse($parts); } else { $parts = array_reverse($parts); if ($parts[0] === '') { array_splice($parts, 0, 0, array_fill(0, 8 - $len, 0)); } else { array_splice($parts, array_search('', $parts), 0, array_fill(0, 8 - $len, 0)); } } } $nibbles = []; $hex = '0123456789abcdef'; foreach (array_map('hexdec', $parts) as $part) { array_push( $nibbles, $hex[($part & 0xF000) >> 12], $hex[($part & 0x0F00) >> 8], $hex[($part & 0x00F0) >> 4], $hex[$part & 0x000F] ); } echo implode('.', $nibbles);

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.00618.56
8.3.50.0070.01321.11
8.3.40.0100.01018.64
8.3.30.0090.00618.84
8.3.20.0000.00820.21
8.3.10.0030.00523.66
8.3.00.0060.00322.42
8.2.180.0120.00616.50
8.2.170.0090.00922.96
8.2.160.0100.00720.53
8.2.150.0080.00024.18
8.2.140.0110.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.95
8.2.110.0030.00620.35
8.2.100.0040.00817.72
8.2.90.0040.00719.22
8.2.80.0090.00017.97
8.2.70.0040.00417.50
8.2.60.0080.00018.05
8.2.50.0040.00418.07
8.2.40.0080.00021.06
8.2.30.0080.00319.95
8.2.20.0040.00417.73
8.2.10.0040.00418.19
8.2.00.0080.00018.14
8.1.280.0070.01125.92
8.1.270.0030.00620.38
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0060.00323.77
8.1.230.0110.00020.96
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0070.00417.22
8.1.190.0040.00417.36
8.1.180.0040.00418.10
8.1.170.0030.00518.68
8.1.160.0040.00422.00
8.1.150.0040.00418.82
8.1.140.0080.00017.52
8.1.130.0000.00717.70
8.1.120.0040.00417.48
8.1.110.0070.00017.31
8.1.100.0030.00317.43
8.1.90.0080.00017.45
8.1.80.0030.00617.51
8.1.70.0000.00717.44
8.1.60.0030.00617.48
8.1.50.0060.00317.46
8.1.40.0040.00417.41
8.1.30.0040.00417.65
8.1.20.0060.00317.73
8.1.10.0040.00417.45
8.1.00.0090.00017.39
8.0.300.0040.00418.77
8.0.290.0050.00216.88
8.0.280.0050.00218.50
8.0.270.0000.00717.19
8.0.260.0060.00017.26
8.0.250.0040.00416.95
8.0.240.0050.00216.99
8.0.230.0030.00316.98
8.0.220.0040.00416.92
8.0.210.0000.00716.82
8.0.200.0000.00616.87
8.0.190.0030.00617.02
8.0.180.0000.00816.97
8.0.170.0000.00816.87
8.0.160.0040.00416.95
8.0.150.0070.00016.85
8.0.140.0030.00316.88
8.0.130.0000.00613.39
8.0.120.0080.00016.94
8.0.110.0030.00516.91
8.0.100.0070.00016.93
8.0.90.0000.00716.95
8.0.80.0120.00316.89
8.0.70.0000.00716.79
8.0.60.0050.00316.95
8.0.50.0050.00316.98
8.0.30.0070.01016.98
8.0.20.0100.00817.40
8.0.10.0040.00417.08
8.0.00.0090.01016.94
7.4.330.0050.00015.08
7.4.320.0030.00316.54
7.4.300.0030.00316.44
7.4.290.0070.00416.53
7.4.280.0040.00416.59
7.4.270.0030.00316.58
7.4.260.0070.00016.49
7.4.250.0070.00016.48
7.4.240.0020.00616.62
7.4.230.0040.00416.63
7.4.220.0140.00916.55
7.4.210.0100.00516.53
7.4.200.0070.00016.38
7.4.160.0120.00616.29
7.4.150.0080.00817.40
7.4.140.0150.00317.86
7.4.130.0120.00816.44
7.4.120.0090.00916.51
7.4.110.0030.01316.50
7.4.100.0140.00316.45
7.4.90.0100.00716.47
7.4.80.0150.00619.39
7.4.70.0080.01216.50
7.4.60.0130.00316.57
7.4.50.0050.00016.46
7.4.40.0000.01616.66
7.4.30.0000.02116.48
7.4.00.0070.01015.15
7.3.330.0000.00513.11
7.3.320.0000.00513.13
7.3.310.0030.00316.30
7.3.300.0000.00716.38
7.3.290.0060.00016.19
7.3.280.0100.00616.30
7.3.270.0090.00917.40
7.3.260.0070.01016.57
7.3.250.0110.00816.48
7.3.240.0120.00616.38
7.3.230.0140.00316.39
7.3.210.0100.00616.28
7.3.200.0090.00919.39
7.3.190.0100.00716.37
7.3.180.0070.01016.35
7.3.170.0040.01216.48
7.3.160.0150.00616.38
7.3.10.0120.00916.87
7.3.00.0160.00316.51
7.2.330.0060.01116.59
7.2.320.0060.01816.82
7.2.310.0100.00616.79
7.2.300.0130.00316.69
7.2.290.0130.01016.74
7.2.130.0130.00716.90
7.2.120.0060.00917.00
7.2.110.0070.01017.15
7.2.100.0060.00617.09
7.2.90.0160.00316.77
7.2.80.0120.00316.87
7.2.70.0090.00616.86
7.2.60.0100.00416.81
7.2.50.0140.00016.97
7.2.40.0110.00316.86
7.2.30.0130.00017.02
7.2.20.0210.00316.87
7.2.10.0230.00616.84
7.2.00.0060.01318.26
7.1.250.0000.01415.83
7.1.200.0040.00715.95
7.1.100.0060.00318.09
7.1.70.0040.00416.93
7.1.60.0110.01520.03
7.1.50.0000.02216.68
7.1.00.0000.08022.54
7.0.200.0230.00614.97
7.0.60.0100.07719.93
7.0.50.0070.08017.81
7.0.40.0130.08020.12
7.0.30.0330.07720.21
7.0.20.0370.07320.00
7.0.10.0270.08720.00
7.0.00.0000.04720.01
5.6.280.0030.06020.91
5.6.210.0070.05020.55
5.6.200.0130.04318.16
5.6.190.0070.08020.52
5.6.180.0430.07020.35
5.6.170.0430.07020.41
5.6.160.0100.06020.50
5.6.150.0070.08318.18
5.6.140.0070.08018.18
5.6.130.0100.08018.20
5.6.120.0030.04720.90
5.6.110.0070.07320.98
5.6.100.0200.07021.01
5.6.90.0130.08320.95
5.6.80.0000.08720.39
5.5.350.0130.05320.29
5.5.340.0100.05718.01
5.5.330.0100.06720.36
5.5.320.0400.05720.43
5.5.310.0200.07320.31
5.5.300.0030.08718.02
5.5.290.0100.03317.87
5.5.280.0100.08020.66
5.5.270.0100.03720.64
5.5.260.0070.09020.86
5.5.250.0070.06020.80
5.5.240.0130.06320.12
5.4.450.0100.06719.37
5.4.440.0170.05719.52
5.4.430.0200.05319.55
5.4.420.0200.05019.09
5.4.410.0170.05318.95
5.4.400.0300.03719.24
5.4.390.0170.05019.16
5.4.380.0070.06019.30
5.4.370.0170.05019.19
5.4.360.0170.05319.25
5.4.350.0230.04319.16
5.4.340.0100.06018.88
5.4.320.0270.05319.16
5.4.310.0100.05719.22
5.4.300.0200.05018.77
5.4.290.0130.05718.75
5.4.280.0070.07719.23
5.4.270.0070.07019.29
5.4.260.0270.05719.28
5.4.250.0100.06318.84
5.4.240.0230.04719.29
5.4.230.0170.05019.08
5.4.220.0200.05319.22
5.4.210.0270.07019.24
5.4.200.0130.05716.61
5.4.190.0200.04719.14
5.4.180.0270.04318.76
5.4.170.0100.06019.06
5.4.160.0070.06319.08
5.4.150.0200.06718.90
5.4.140.0170.06016.33
5.4.130.0100.05316.59
5.4.120.0100.05316.42
5.4.110.0000.08316.42
5.4.100.0170.06316.23
5.4.90.0170.05016.21
5.4.80.0130.05016.20
5.4.70.0130.05316.19
5.4.60.0270.05316.40
5.4.50.0000.07016.31
5.4.40.0170.03716.32
5.4.30.0100.04016.38
5.4.20.0030.04316.38

preferences:
62.79 ms | 401 KiB | 5 Q