3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function createStringFromMap($map) { $chars = array('C*'); foreach (array_chunk($map, 8) as $byte) { $char = 0; foreach ($byte as $position => $bit) { $char |= ($bit << (7 - $position)); } $chars[] = $char; } return call_user_func_array('pack', $chars); } echo createStringFromMap(array(0, 1, 0, 0, 0, 0, 0, 1));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
A