3v4l.org

run code in 300+ PHP versions simultaneously
<?php $decimal= 0x8000000; const FLAG_1 = 0x1b; const FLAG_2 = 0x2; const FLAG_3 = 0x4; const FLAG_4 = 0x8; const FLAG_5 = 0x10; const FLAG_6 = 0x20; const FLAG_7 = 0x40; const FLAG_8 = 0x80; const FLAG_9 = 0x100; const FLAG_10 = 0x200; const FLAG_11 = 0x400; const FLAG_12 = 0x800; function show_flags ($decimal) { if ($decimal & FLAG_1) { echo "Flag 1 included.<br>\n"; } if ($decimal & FLAG_2) { echo "Flag 2 included.<br>\n"; } if ($decimal & FLAG_3) { echo "Flag 3 included.<br>\n"; } if ($decimal & FLAG_4) { echo "Flag 4 included.<br>\n"; } if ($decimal & FLAG_5) { echo "Flag 5 included.<br>\n"; } if ($decimal & FLAG_6) { echo "Flag 6 included.<br>\n"; } if ($decimal & FLAG_7) { echo "Flag 7 included.<br>\n"; } if ($decimal & FLAG_8) { echo "Flag 8 included.<br>\n"; } if ($decimal & FLAG_9) { echo "Flag 9 included.<br>\n"; } if ($decimal & FLAG_10) { echo "Flag 10 included.<br>\n"; } if ($decimal & FLAG_11) { echo "Flag 11 included.<br>\n"; } if ($decimal & FLAG_12) { echo "Flag 12 included.<br>\n"; } } show_flags($decimal);
based on E7iUb
Output for 7.3.0 - 7.3.28, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3