Re: [Strawpoll] Promoting redefining constant to exception

From: Date: Tue, 25 Jan 2022 20:11:13 +0000
Subject: Re: [Strawpoll] Promoting redefining constant to exception
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-116922@lists.php.net to get a copy of this message
On Tue, Jan 25, 2022 at 3:08 PM Kamil Tekiela <tekiela246@gmail.com> wrote: > A constant is a value that, unlike a variable, cannot be reassociated with > a different value. A properly written software should never redefine > constants. The possibility of redefining constants in PHP should be > considered a bug rather than a feature. > Constants are not good for configuration values that can be changed. A > proper data structure should be used instead. Constants should never have > to be redefined, either by the software itself, its tests or its > extensions. Constant values must remain the same under all circumstances > otherwise they are no longer constants. > > Regardless of whether it's a proper use of constants or not, it's something that was in place long before I started and not something we can easily change now. Also, I'm not suggesting that we allow constants to be redefined. My setup actually works because you can't redefine them. The idea is that the local configuration file is processed first. > +1 to remove it in PHP 9.0 > -- Chase Peeler chasepeeler@gmail.com

« previous php.internals (#116922) next »