Silent Optimisation Of Variables

<?php


$a;
// crii crii

3 || $b;
// ...

echo $c;
// warning: undefined variable $c;

?>

See PHP optimisation in action: undefined variables are only reported when they are used (sic).

The first one is omitted : there are no operation with it.

The second one is skipped: no need to execute 2nd term when the first one is already true.

The third one is reporting a warning, as expected.

See Also

PHP Error Messages

PHP Features

Last updated: 14 July 2026