Re: Constants and Access Modifiers
| From: | lists@rhsoft.net | Date: | Sun, 12 Nov 2017 10:10:22 +0000 |
| Subject: | Re: Constants and Access Modifiers | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101129@lists.php.net to get a copy of this message | ||
Am 12.11.2017 um 10:50 schrieb Alice Wonder:
On 11/12/2017 01:38 AM, Tony Marston wrote:what about both of you read the initial post of that thread as well as the manual at http://php.net/manual/en/language.oop5.interfaces.php _______________________- that's the topic and not arbitary change constants! A constant defined in an interface cannot be overwritten in the class that implements the interface, however, further subclasses can overwrite the content of the constant at will - https://3v4l.org/DFB37 - https://3v4l.org/9LMciJust because some languages use a corrupt definition of "constant" is no reason for PHP to do the same. A constant has a value which, once defined, cannot be changed. It is not logical to define a constant name in one place and its value in another.Plus plus on this. A constant does not change. If it changes it is a variable. I do not know anything about Dart but if they are changing the meaning of well-defined terms like constant, I worry that there will be programs with security holes simply because some developers will not understand what they mean by the terms they define.