3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "testing bit operations\n"; $flag = 0; echo "To start, the setting will be off: $flag\n"; echo "Now we will see if any of the bits are set.\n"; echo "1: ". $flag & 1 == 1 ."\n"; echo "2: ". $flag & 2 == 2 ."\n"; echo "4: ". $flag & 4 == 4 ."\n"; echo "test";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
testing bit operations To start, the setting will be off: 0 Now we will see if any of the bits are set. Warning: A non-numeric value encountered in /in/RUGIR on line 6 1 Warning: A non-numeric value encountered in /in/RUGIR on line 7 0 Warning: A non-numeric value encountered in /in/RUGIR on line 8 0test
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
testing bit operations To start, the setting will be off: 0 Now we will see if any of the bits are set. Notice: A non well formed numeric value encountered in /in/RUGIR on line 6 1 Notice: A non well formed numeric value encountered in /in/RUGIR on line 7 0 Notice: A non well formed numeric value encountered in /in/RUGIR on line 8 0test
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.3.32 - 7.3.33
testing bit operations To start, the setting will be off: 0 Now we will see if any of the bits are set. 100test

preferences:
172.32 ms | 403 KiB | 229 Q