Reputation: 960
Here's what I was doing in the past
//file: bar.php
defined('MYC') or define('MYC', 'val1');
//file: bootstrap.php
define('MYC', 'val2');
I would include bootstrap.php first which would set MYC = 'val2'
.
Now bar.php is in the \Foo\Bar namespace, i.e. to say
//file: bar.php
namespace Foo\Bar;
defined('MYC') or define('MYC', 'val1');
//file: bootstrap.php
//following doesn't work
//const \Foo\Bar\MYC = 'val2';
//?? what do I do here ??
Upvotes: 0
Views: 2555