On Tue, Jan 25, 2022 at 9:45 PM Chase Peeler <chasepee...@gmail.com> wrote:

> it will make this much more difficult to read since the constants.php will 
> have to be
> updated:
>
> if(!defined('dbserver')){
>   define('dbserver','productiondb.example.com');
> }
> if(!defined('otherconstant')){
>    define('otherconstants','foobar');
> }


You could use this form for conciseness:
```
defined('dbserver')      or  define('dbserver', 'productiondb.example.com');
defined('otherconstant') or  define('otherconstant', 'foobar');
```

IMHO it's clearer than `@define()` as it makes it explicit where you
expect a possible previous definition and where you don't.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to