com php-langspec: Case-insensitive constants are deprecated: spec/06-constants.md tests/constants/constants.phpt

From: Date: Mon, 10 Sep 2018 11:47:58 +0000
Subject: com php-langspec: Case-insensitive constants are deprecated: spec/06-constants.md tests/constants/constants.phpt
Groups: php.standards.cvs 
Request: Send a blank email to standards--cvs+get-417@lists.php.net to get a copy of this message
Commit: ea03278e7e3d48061ef6744570b8f36b7a20d02c Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 10 Sep 2018 13:47:58 +0200 Parents: bbbcec63be0487cad32b42b823d3da3f6057226d Branches: master Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=ea03278e7e3d48061ef6744570b8f36b7a20d02c Log: Case-insensitive constants are deprecated Changed paths: M spec/06-constants.md M tests/constants/constants.phpt Diff: diff --git a/spec/06-constants.md b/spec/06-constants.md index 5670599..57720df 100644 --- a/spec/06-constants.md +++ b/spec/06-constants.md @@ -14,7 +14,8 @@ Specifically: name while that for a d-constant can contain any source character. - The name of a c-constant is case-sensitive while that for a d-constant can be case-sensitive or case-insensitive based on the - value of the third argument passed to define. + value of the third argument passed to define. The definition of + case-insensitive constants is deprecated. - If define is able to define the given name, it returns TRUE; otherwise, it returns FALSE. @@ -30,7 +31,7 @@ string. ```PHP const MAX_HEIGHT = 10.5; // define two (case-sensitive) c-constants const UPPER_LIMIT = MAX_HEIGHT; -define('COEFFICIENT_1', 2.345, TRUE); // define a case-insensitive d-constant +define('COEFFICIENT_1', 2.345, TRUE); // define a case-insensitive d-constant (deprecated) define('FAILURE', FALSE, FALSE); // define a case-sensitive d-constant ``` diff --git a/tests/constants/constants.phpt b/tests/constants/constants.phpt index 323a521..ec48221 100644 --- a/tests/constants/constants.phpt +++ b/tests/constants/constants.phpt @@ -184,6 +184,8 @@ echo "CON1: " . C3::CON1 . "\n"; // use :: notation, as a const is implicitly st --EXPECTF-- define STATUS1 succeeded; value is >1< define MIN succeeded; value is >10< + +Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line %d define MAX succeeded; value is >20< define MY_PI succeeded; value is >3.1415926< define MY_COLOR succeeded; value is >red<

« previous php.standards.cvs (#417) next »