Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread Fleshgrinder
On 11/12/2017 7:25 PM, Rowan Collins wrote: > On 12/11/2017 09:49, Fleshgrinder wrote: >> Other languages allow you to have a contract on fields. >> >> class A { const FOO: int = 42; } >> class A { final static $foo: int = 42; } >> >> These are basically the same, as you already said. How

Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread li...@rhsoft.net
Am 12.11.2017 um 19:25 schrieb Rowan Collins: On 12/11/2017 09:49, Fleshgrinder wrote: There is one thing that differs for the const and the field: a const value must be known at compile time, whereas a field value does not. An important difference! class A { abstract public const FOO: in

Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread Rowan Collins
On 12/11/2017 09:49, Fleshgrinder wrote: Other languages allow you to have a contract on fields. class A { const FOO: int = 42; } class A { final static $foo: int = 42; } These are basically the same, as you already said. However, I added a contract to both of them. Yes, I wondered

Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread li...@rhsoft.net
Am 12.11.2017 um 10:50 schrieb Alice Wonder: On 11/12/2017 01:38 AM, Tony Marston wrote: Just 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

Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread Alice Wonder
On 11/12/2017 01:38 AM, Tony Marston wrote: wrote in message news:549c4634-ac38-41d3-ab43-f816a9f2b...@fleshgrinder.com... On 11/12/2017 12:44 AM, Stanislav Malyshev wrote: Hi! Yes, Dart has a different understanding of const, which is exactly why I posted it for you guys. In the hope that i

Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread Fleshgrinder
On 11/11/2017 9:51 PM, Rowan Collins wrote: > On 11/11/2017 18:39, Fleshgrinder wrote: >> On 11/6/2017 1:44 AM, Stanislav Malyshev wrote: >> >>>  From this link, it looks like const in Dart has pretty much nothing in >>> common with const in PHP, besides name, so in the interest of avoiding >>> con

Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread Tony Marston
wrote in message news:549c4634-ac38-41d3-ab43-f816a9f2b...@fleshgrinder.com... On 11/12/2017 12:44 AM, Stanislav Malyshev wrote: Hi! Yes, Dart has a different understanding of const, which is exactly why I posted it for you guys. In the hope that it helps to get more different views on the to

Re: [PHP-DEV] Constants and Access Modifiers

2017-11-12 Thread Fleshgrinder
On 11/12/2017 12:44 AM, Stanislav Malyshev wrote: > Hi! > >> Yes, Dart has a different understanding of const, which is exactly why I >> posted it for you guys. In the hope that it helps to get more different >> views on the topic. Currently you are too concentrated on how it is >> implemented in