3v4l.org

run code in 300+ PHP versions simultaneously
<?php function toHex($n) { $n = intval($n); if (!$n) return '00'; $n = max(0, min($n, 255)); // make sure the $n is not bigger than 255 and not less than 0 $index1 = (int) ($n - ($n % 16)) / 16; $index2 = (int) $n % 16; return substr("0123456789ABCDEF", $index1, 1) . substr("0123456789ABCDEF", $index2, 1); } $r = 254; $g = 255; $b = 0; echo $hex = '#' . toHex($r) . toHex($g) . toHex($b); ?>
Output for git.master, git.master_jit, rfc.property-hooks
#FEFF00

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:
36.96 ms | 401 KiB | 8 Q