3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('TYPE_TEST1', 1 << 0); define('TYPE_TEST2', 1 << 1); define('TYPE_TEST3', 1 << 2); define('TYPE_TEST4', 1 << 3); define('TYPE_TEST5', 1 << 4); $test = TYPE_TEST2 | TYPE_TEST4; if ($test & TYPE_TEST1) { echo "1!\n"; } if ($test & TYPE_TEST2) { echo "2!\n"; } if ($test & TYPE_TEST3) { echo "3!\n"; } if ($test & TYPE_TEST4) { echo "4!\n"; } if ($test & TYPE_TEST5) { echo "5!\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2! 4!