According to my tests on http://3v4l.org/ZCJWA following example (For PHP 5.3.10 – 5.4.6):
<?php
namespace Foo;
define('Foo\\true', false);
define('Foo\\false', true);
var_dump(
true,
false,
1 === 1,
1 === 0
);
will return:
bool(false)
bool(false)
bool(true)
bool(false)
Why can you overwrite true with false but not false with true?
After your 1st
define,trueis now defined to befalse, soFoo\\falsegets set tofalse.To get it working as expected, you should should be setting
Foo\\trueandFoo\\falseto the global space values oftrueandfalserespectively: