3v4l.org

run code in 300+ PHP versions simultaneously
<?php $address = '1::1'; $parts = explode(':', $address); $len = count($parts); if ($len < 8) { if ($parts[0] === '') { array_splice($parts, 0, 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);
Output for git.master, git.master_jit, rfc.property-hooks
0.0.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.85 ms | 401 KiB | 8 Q