Re: Class Constant Finalization
| From: | Rowan Collins | Date: | Wed, 25 Jan 2017 19:17:03 +0000 |
| Subject: | Re: Class Constant Finalization | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97962@lists.php.net to get a copy of this message | ||
On 25/01/2017 08:49, Niklas Keller wrote:
2017-01-25 9:27 GMT+01:00 Wes <netmo.php@gmail.com>:You mean, make all constants non-inheritable? Why? Late static binding is a documented language feature, I don't see why it's any weirder for constants to participate in it than static fields and methods. Regards, -- Rowan Collins [IMSoP]They don't belong to a class only, but to a class and all its descendants. Ideally, descendants should not inherit constants (or anything static), but we can't change that now, so final could make sense here. Basically, they should work exactly like static fields, except that static fields can be re-assigned, while constants may not.Well, we can deprecate them and remove it with PHP 8.