var_export(array(NULL, TRUE, FALSE));
Result:
array (
0 => NULL,
1 => true,
2 => false,
)
NULL is uppercase, but true and false are lowercase.
I suppose this has a historic reason, but I don't find it documented anywhere.
The following experiment is also quite interesting, and suggests that internally the "canonical" spelling of null, true and false is lowercase, contrary to what var_export() does: https://3v4l.org/ggM4E
define('false', '- false -');
define('FALSE', '- FALSE -');
define('null', '- null -');
define('NULL', '- NULL -');
var_export(array(TRUE, true, FALSE, false, NULL, null));
It shows that:
- define('NULL', ..) and define('FALSE', ..) are allowed but have no effect in recent PHP versions.
- define('null', ..) and define('false', ..) give a notice, but also have no effect in recent PHP versions.
- In older PHP version (4.x), 'NULL' and 'FALSE' CAN be redefined and it does have an effect. But 'null' and 'false' cannot be redefined.
Oh, just for completeness: define('NULL', ..) and define('FALSE', ..) are actually NOT ignored if within a namespace, in PHP 5.x. See https://3v4l.org/JusvB. Or if you really want, you can even override 'null' and 'false' within a namespace: https://3v4l.org/i796C
Related: Uppercase Booleans vs. Lowercase in PHP, see this answer: https://stackoverflow.com/a/3807178/246724