3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $bitMask = 5; $bitMask = str_split(strrev((string)decbin((int)$bitMask))); $splited = array(); foreach($bitMask as $pos => $bit) { if (0 != $bit) { $splited[] = /* pow(2, $pos); */ (1 << ($pos - 1)) } } var_dump($splited);
Output for 5.3.0 - 5.4.23
Parse error: syntax error, unexpected '}' in /in/QZ1s7 on line 11
Process exited with code 255.