Req #67104 [Opn->Asn]: Behaviour of defining constants is inconsistent and misleading

From: Date: Wed, 12 Sep 2018 23:58:29 +0000
Subject: Req #67104 [Opn->Asn]: Behaviour of defining constants is inconsistent and misleading
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217022@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67104&edit=1 ID: 67104 Updated by: nikic@php.net Reported by: ss23 at ss23 dot geek dot nz Summary: Behaviour of defining constants is inconsistent and misleading -Status: Open +Status: Assigned Type: Feature/Change Request Package: *General Issues PHP Version: Irrelevant -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: This will be resolved in PHP 8 by https://wiki.php.net/rfc/case_insensitive_constant_deprecation. Redefinition checks for case-insensitive constants currently do not work correctly and will not be fixed until support is removed entirely. Previous Comments: ------------------------------------------------------------------------ [2014-05-07 08:58:14] iam4webwork at hotmail dot com The following result occurs for PHP4.3.0-5.1.2 (see http://3v4l.org/M1ZrQ#v430) bool(true) bool(false) bool(false) bool(true) These results seem fine. What changed and why? I agree that there sh/b s.thing in case s.one tries to override a built-in constant. ------------------------------------------------------------------------ [2014-04-21 23:57:23] ss23 at ss23 dot geek dot nz Description: ------------ The current behaviour is very confusing. Test script: --------------- <?php define('TRUE', false); var_dump(true); var_dump(TRUE); var_dump(constant('TRUE')); var_dump(constant('true')); Expected result: ---------------- Anything but this. An E_ERROR (or even E_WARNING) on the initial define would be enough. Actual result: -------------- bool(true) bool(true) bool(false) bool(true) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67104&edit=1

« previous php.bugs (#217022) next »