3v4l.org

run code in 300+ PHP versions simultaneously
<?php function text2bin($text){ return implode("", array_map(function($v){ return (ctype_alpha($v) ? sprintf("%08d", decbin(ord($v))) : $v) . " "; }, str_split($text))); } echo text2bin("Hi");

preferences:
62.63 ms | 2290 KiB | 5 Q