Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116914 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8617 invoked from network); 23 Jan 2022 02:17:34 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 23 Jan 2022 02:17:34 -0000 To: internals@lists.php.net Date: Sun, 23 Jan 2022 03:29:26 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 87.81.129.66 Subject: [Strawpoll] Promoting redefining constant to exception From: marandall@php.net (Mark Randall) Message-ID: Internals, While cleaning up some PRs I was prompted to re-visit one I had outstanding about exception-throwing behaviour when redefining constants, this applies to functions like define and language syntax constructs such as const. There have been a few discussions in the past about the topic. Here is one from 2016 from Dmitry: https://wiki.php.net/rfc/constant_redefinition Discussion: https://externals.io/message/93885 My own PR: https://github.com/php/php-src/pull/5265 Since Dmitry's RFC was made in 2016, and my PR a while ago, attempted redeclaration was promoted from a notice to a warning, but I still think it's sensible to go one step further. There was mention on github that there was some resistence to promotion to exception in the past, but I think there is a strong possibility that the mood may be different many years later, with PHPs positive moves towards throwing on poorly defined or illogical behaviour. To gauge this, I'm throwing out a non-binding strawpoll to get the lay of the land before doing anything else with it. If there is general favour I'll fix up my patch and do a proper RFC. https://wiki.php.net/redefine_constants_exception_strawpoll Mark Randall