Why can you overwrite true but not false in namespaces?

constants, php

Solution

After your 1st `define`, `true` is now defined to be `false`, so `Foo\\false` gets set to `false`.

To get it working as expected, you should should be setting `Foo\\true` and `Foo\\false` to the global space values of `true` and `false` respectively:

define('Foo\\true', \false);
define('Foo\\false', \true);

Problem

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`?

Original source