3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bit2chr_mask(string $flags, int $bitmask): string { $chrmask = ''; for($bit = 1, $i = 0; $bit < $bitmask; $bit <<= 1, $i++) { if($bitmask & $bit){ $chrmask .= $flags[$i]; } } return $chrmask; } var_dump(bit2chr_mask('abcdefghijklmnopqrstuvwxyz1234567890', 2147483648));
based on fveXd
Output for hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.0
string(0) ""
Output for 5.6.0 - 5.6.38
Parse error: syntax error, unexpected ':', expecting '{' in /in/9ikdh on line 3
Process exited with code 255.