# [VOTE] Deprecate and remove case-insensitive constants

- Thread: https://externals.io/message/102656
- Original archive: https://news-web.php.net/php.internals/102656
- Started by Nikita Popov on 2018-07-09T08:36:46+00:00
- Messages: 8
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #102656 — Nikita Popov — 2018-07-09T08:36:46+00:00

URL: https://externals.io/message/102656#102656

Hi,

I would like to open the vote on the RFC for the deprecation (in PHP 7.3)
and removal (in PHP 8.0) of case-insensitive constants.

https://wiki.php.net/rfc/case_insensitive_constant_deprecation

If you missed the discussion for this RFC, you can read up on it here:

https://externals.io/message/102389

As this is a language change, the vote requires a 2/3 supermajority. The
vote will be open until 2018-07-09.

Regards,
Nikita

---

## #102658 — Nikita Popov — 2018-07-09T09:06:17+00:00

URL: https://externals.io/message/102656#102658 · In reply to: #102656

> Hi,
>
> I would like to open the vote on the RFC for the deprecation (in PHP 7.3)
> and removal (in PHP 8.0) of case-insensitive constants.
>
> https://wiki.php.net/rfc/case_insensitive_constant_deprecation
>
> If you missed the discussion for this RFC, you can read up on it here:
>
> https://externals.io/message/102389
>
> As this is a language change, the vote requires a 2/3 supermajority. The
> vote will be open until 2018-07-09.
>

Whoops, this was supposed to be 2018-07-16.

Nikita

---

## #102671 — Andrea Faulds — 2018-07-09T16:18:48+00:00

URL: https://externals.io/message/102656#102671 · In reply to: #102656

Hi Nikita,

I'm a terrible person for only bringing this up now (I apologise for not 
following the list as closely as I used to), but one reason 
case-insensitive constants are maybe useful is they leave open the 
possibility of being able to access functions as values in future: like 
some constants, function names are case-insensitive, and a fallback 
could be added to constant accesses to return a closure of the function 
with the same name if no constant is found.

Of course, removing case-insensitive constants wouldn't preclude such a 
feature, just make it a little more annoying to implement, so this is 
not really a significant reason to vote against. To that end, I'll vote 
in favour of this deprecation.

Thanks!
-- 
Andrea Faulds
https://ajf.me/

---

## #102722 — Niklas Keller — 2018-07-10T17:18:05+00:00

URL: https://externals.io/message/102656#102722 · In reply to: #102671

> Hi Nikita,
>
> I'm a terrible person for only bringing this up now (I apologise for not
> following the list as closely as I used to), but one reason
> case-insensitive constants are maybe useful is they leave open the
> possibility of being able to access functions as values in future: like
> some constants, function names are case-insensitive, and a fallback
> could be added to constant accesses to return a closure of the function
> with the same name if no constant is found.
>
> Of course, removing case-insensitive constants wouldn't preclude such a
> feature, just make it a little more annoying to implement, so this is
> not really a significant reason to vote against. To that end, I'll vote
> in favour of this deprecation.

No, thanks. The fallback is already a bad thing for functions, we
don't need another one.

If such a feature would be implemented, it'd probably be via combined
symbol tables, making either everything case-insensitive or everything
case-sensitive.

Regards, Niklas

---

## #102862 — Nikita Popov — 2018-07-16T17:00:33+00:00

URL: https://externals.io/message/102656#102862 · In reply to: #102656

> Hi,
>
> I would like to open the vote on the RFC for the deprecation (in PHP 7.3)
> and removal (in PHP 8.0) of case-insensitive constants.
>
> https://wiki.php.net/rfc/case_insensitive_constant_deprecation
>
> If you missed the discussion for this RFC, you can read up on it here:
>
> https://externals.io/message/102389
>
> As this is a language change, the vote requires a 2/3 supermajority. The
> vote will be open until 2018-07-09.
>

I'm happy to announce that this RFC has been accepted unanimously with 39
votes in favor and 0 against.

Nikita

---

## #102904 — Christoph M. Becker — 2018-07-17T22:18:54+00:00

URL: https://externals.io/message/102656#102904 · In reply to: #102862

> 
> 
> > […]
> 
> I'm happy to announce that this RFC has been accepted unanimously with 39
> votes in favor and 0 against.

Looking back at <https://externals.io/message/100535>, I'm pleasantly
surprised!  Thanks!

-- 
Christoph M. Becker

---

## #104303 — Nikita Popov — 2019-02-08T08:59:19+00:00

URL: https://externals.io/message/102656#104303

On Thu, Feb 7, 2019 at 11:31 PM Christoph M. Becker <cmbecker69@gmx.de>
wrote:

> 
>
> > […]
> wrote:
> > […]
> 7.3)
> > […]
>
> I just learned that com_load_typelib()[1] automatically registers enum
> members as constants, and allows to register them as case-insensitive
> (the default is case-sensitive, despite the documentation, which I'm
> going to fix right away).  If a typelib is implicitly loaded,
> com.autoregister_casesensitive[2] controls whether constants are
> registered case-sensitively or not.  It seems to me com_load_typelib()
> should trigger a deprecation warning, if `FALSE` is passed as second
> argument, and also disabling com.autoregister_casesensitive should.
>
> Can this be amemded for PHP 7.3.3, or are there any objections?
>
> [1] <http://php.net/manual/en/function.com-load-typelib.php>
> [2]
> <
> http://php.net/manual/en/com.configuration.php#ini.com.autoregister-casesensitive
> > […]
>

Thanks for pointing this out! Agree that both of those should be deprecated
... in fact the necessary for code handling case-insensitive constants is
already gone in master, so they'll definitely have to go as well.

Personally I think it would be best to add the deprecations in 7.4, as
there's no particular rush and we usually don't add deprecations in patch
releases. I don't have a problem with them being added in 7.3.3 either
though, this is not exactly prime functionality and we're early in the
release cycle...

Nikita

---

## #104352 — Christoph M. Becker — 2019-02-11T19:00:34+00:00

URL: https://externals.io/message/102656#104352

> On Thu, Feb 7, 2019 at 11:31 PM Christoph M. Becker <cmbecker69@gmx.de>
> wrote:
> 
> > […]
> 
> Thanks for pointing this out! Agree that both of those should be deprecated
> .... in fact the necessary for code handling case-insensitive constants is
> already gone in master, so they'll definitely have to go as well.
> 
> Personally I think it would be best to add the deprecations in 7.4, as
> there's no particular rush and we usually don't add deprecations in patch
> releases. I don't have a problem with them being added in 7.3.3 either
> though, this is not exactly prime functionality and we're early in the
> release cycle...

Postponing this to 7.4 is fine for me.  I'll provide a respective PR
within the next days.

-- 
Christoph M. Becker
