3v4l.org

run code in 300+ PHP versions simultaneously
<?php $decimal= 3660; 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);
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Flag 1 included.<br> Flag 3 included.<br> Flag 4 included.<br> Flag 7 included.<br> Flag 10 included.<br> Flag 11 included.<br> Flag 12 included.<br>
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Flag 1 included.<br> Flag 3 included.<br> Flag 4 included.<br> Flag 7 included.<br> Flag 10 included.<br> Flag 11 included.<br> Flag 12 included.<br>

preferences:
144.12 ms | 402 KiB | 153 Q