3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createStringFromMap($map) { $chars = array('C*'); end($map); $last = key($map); for ($i = $j = $char = 0; $i <= $end; $i++) { $char |= ($map[$i] << (7 - $j)); if (++$j === 8) { $chars[] = $char; $j = $char = 0; } } return call_user_func_array('pack', $chars); } $map = array(); $map[1] = 1; $map[9] = 1; $map[17] = 1; $map[25] = 1; echo createStringFromMap($map);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $end in /in/X0GbB on line 7 Warning: Undefined array key 0 in /in/X0GbB on line 8 Warning: Undefined variable $end in /in/X0GbB on line 7

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