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

From: Date: Mon, 08 Apr 2019 07:10:24 +0000
Subject: com php-langspec: Case-insensitive constants are no longer supported: spec/06-constants.md tests/constants/constants.phpt
Groups: php.standards.cvs 
Request: Send a blank email to standards--cvs+get-439@lists.php.net to get a copy of this message
Commit: 231e64995d5e6446101aa3da0d5ef62e2b5f204f Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 8 Apr 2019 09:10:24 +0200 Parents: 64dd279d2829244050bb099f65a987c50324b8f5 Branches: master Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=231e64995d5e6446101aa3da0d5ef62e2b5f204f Log: Case-insensitive constants are no longer supported 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 3b6b611..0621718 100644 --- a/spec/06-constants.md +++ b/spec/06-constants.md @@ -12,10 +12,6 @@ Specifically: - The name of a c-constant must comply with the lexical grammar for a 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. The definition of - case-insensitive constants is deprecated. - If define is able to define the given name, it returns TRUE; otherwise, it returns FALSE. diff --git a/tests/constants/constants.phpt b/tests/constants/constants.phpt index 5e6b66f..23f3324 100644 --- a/tests/constants/constants.phpt +++ b/tests/constants/constants.phpt @@ -11,9 +11,9 @@ PHP Spec test generated from ./constants/constants.php error_reporting(-1); -function trace($name, $value, $b = FALSE) +function trace($name, $value) { - $r = define($name, $value, $b); + $r = define($name, $value); echo "define $name " . ($r ? "succeeded" : "failed"); if (defined($name)) echo "; value is >" . constant($name) . "<\n"; @@ -26,7 +26,7 @@ function trace($name, $value, $b = FALSE) trace("STATUS1", TRUE); trace("MIN", 10); -trace("MAX", 20, TRUE); // HHVM Warning: Case insensitive constant names are not supported in HipHop +trace("MAX", 20); trace("MY_PI", 3.1415926); trace("MY_COLOR", "red"); trace("C1", NULL); @@ -184,8 +184,6 @@ 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< @@ -208,7 +206,9 @@ define #%& succeeded; value is >200< Notice: Constant MY_COLOR already defined in %s/constants/constants.php on line 13 define MY_COLOR failed; value is >red< -define TRUE succeeded; value is >999< + +Notice: Constant TRUE already defined in %s/constants/constants.php on line 13 +define TRUE failed; value is >1< TRUE's value:1 define COLORS succeeded Notice: Array to string conversion in %s/constants/constants.php on line 16

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