3v4l.org

run code in 200+ 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 - 7.1.7
A