PHP 8.5.0 Beta 1 available for testing

Voting

: four minus zero?
(Example: nine)

The Note You're Voting On

Carsten Milkau
13 years ago
Beware the unusual order of bit-wise operators and comparison operators, this has often lead to bugs in my experience. For instance:

<?php if ( $flags & MASK == 1) do_something(); ?>

will not do what you might expect from other languages. Use

<?php if (($flags & MASK) == 1) do_something(); ?>

in PHP instead.

<< Back to user notes page

To Top