Re: [PHP-DEV] RFC: autoconst

2021-08-01 Thread Serhii Smirnov
Thank you! Seems like Enum covers this case. вс, 1 авг. 2021 г., 21:58 Rowan Tommins : > On 01/08/2021 16:59, Serhii Smirnov wrote: > > class Features > > { > > const FEATURE_FLAG_WITH_SOME_LONG_NAME = > > 'feature_flag_with_some_long_name'; > >

Re: [PHP-DEV] RFC: autoconst

2021-08-01 Thread Serhii Smirnov
> 1 авг. 2021 г., в 17:08, Rowan Tommins написал(а): > > On 01/08/2021 12:21, Serhii Smirnov wrote: >> instead of defining constants like: >> const FOO = 'FOO'; >> >> they could be defined like: >> autoconst FOO; // defines a constant FOO with

Re: [PHP-DEV] RFC: autoconst

2021-08-01 Thread Serhii Smirnov
ror in the classic const definition? > 1 авг. 2021 г., в 15:00, Max Semenik написал(а): > > вс, 1 авг. 2021 г., 14:22 Serhii Smirnov <mailto:free.smile...@gmail.com>>: > instead of defining constants like: > const FOO = 'FOO'; > > they could be defined lik

[PHP-DEV] RFC: autoconst

2021-08-01 Thread Serhii Smirnov
Hello! This is my first RFC proposal. I have an idea about introducing autoconst keyword. Motivation: reduce duplicated code (copy/pasting constant name as value) reducing potential typo errors in constant values instead of defining constants like: const FOO = 'FOO'; they could be defined like: