Is there a way to enable full boolean evaluation in PHP without a compiler switch?

PHP does not support full boolean evaluation by default, as it uses lazy evaluation for boolean expressions. To enable full boolean evaluation without a compiler switch, you can use bitwise operators to force the evaluation of both sides of the expression. By using bitwise operators, you can ensure that both operands are evaluated before the result is determined.

// Enable full boolean evaluation using bitwise operators
$result = (bool) ($a & $b);