Be careful using NULL together with namespaces. If a NULL constant is redefined in a namespace other than global, you will get unexpected results when comparing to NULL inside the namespace. Instead always use \NULL, \FALSE, and \TRUE when comparing. Otherwise it may lead to application failures and potential security issues where certain checks could be effectively disabled.
A simple example to demonstrate the behavior:
<?php
namespace RedefinedConstants {
define('NULL', 'I am not global NULL!');
define('TRUE', 'I am not global TRUE!');
define('FALSE', 'I am not global FALSE!');
define('RedefinedConstants\NULL', 'I am not NULL!', \TRUE);
define('RedefinedConstants\FALSE', 'I am not FALSE!', \TRUE);
define('RedefinedConstants\TRUE', 'I am not TRUE!', \TRUE);
var_dump(
NULL, \NULL, null, \null, Null, \Null,
FALSE, \FALSE, false, \false, False, \False,
TRUE, \TRUE, true, \true, True, \True
);
}
?>