com php-langspec: Case-insensitive constants are no longer supported: spec/06-constants.md tests/constants/constants.phpt
[email protected] (Nikita Popov) Mon, 08 Apr 2019 07:10:24 +0000
| Newsgroups | php.standards.cvs |
|---|---|
| Message-ID | <[email protected]> |
Commit: 231e64995d5e6446101aa3da0d5ef62e2b5f204f=0AAuthor: Nikita Pop= ov <[email protected]> Mon, 8 Apr 2019 09:10:24 +0200=0AParents:= 64dd279d2829244050bb099f65a987c50324b8f5=0ABranches: master=0A=0ALink: = http://git.php.net/?p=3Dphp-langspec.git;a=3Dcommitdiff;h=3D231e64995= d5e6446101aa3da0d5ef62e2b5f204f=0A=0ALog:=0ACase-insensitive constants are = no longer supported=0A=0AChanged paths:=0A M spec/06-constants.md=0A M = tests/constants/constants.phpt=0A=0A=0ADiff:=0Adiff --git a/spec/06-constan= ts.md b/spec/06-constants.md=0Aindex 3b6b611..0621718 100644=0A--- a/spec/0= 6-constants.md=0A+++ b/spec/06-constants.md=0A@@ -12,10 +12,6 @@ Specifical= ly:=0A =0A - The name of a c-constant must comply with the lexical gramma= r for a=0A name while that for a d-constant can contain any source char= acter.=0A-- The name of a c-constant is case-sensitive while that for a= =0A- d-constant can be case-sensitive or case-insensitive based on the= =0A- value of the third argument passed to `define`. The definition of= =0A- case-insensitive constants is deprecated.=0A - If `define` is abl= e to define the given name, it returns `TRUE`;=0A otherwise, it returns= `FALSE`.=0A =0Adiff --git a/tests/constants/constants.phpt b/tests/constan= ts/constants.phpt=0Aindex 5e6b66f..23f3324 100644=0A--- a/tests/constants/c= onstants.phpt=0A+++ b/tests/constants/constants.phpt=0A@@ -11,9 +11,9 @@ PH= P Spec test generated from ./constants/constants.php=0A =0A error_reporting= (-1);=0A =0A-function trace($name, $value, $b =3D FALSE)=0A+function trace(= $name, $value)=0A {=0A-=09$r =3D define($name, $value, $b);=0A+=09$r =3D de= fine($name, $value);=0A =09echo "define $name " . ($r ? "succeeded" : "fail= ed");=0A =09if (defined($name))=0A =09=09echo "; value is >" . constant($na= me) . "<\n";=0A@@ -26,7 +26,7 @@ function trace($name, $value, $b =3D FALS= E)=0A =0A trace("STATUS1", TRUE);=0A trace("MIN", 10);=0A-trace("MAX", 20, = TRUE);=09=09// HHVM Warning: Case insensitive constant names are not suppor= ted in HipHop=0A+trace("MAX", 20);=0A trace("MY_PI", 3.1415926);=0A trace("= MY_COLOR", "red");=0A trace("C1", NULL);=0A@@ -184,8 +184,6 @@ echo "CON1: = " . C3::CON1 . "\n";=09// use :: notation, as a const is implicitly st=0A -= -EXPECTF--=0A define STATUS1 succeeded; value is >1<=0A define MIN succeede= d; value is >10<=0A-=0A-Deprecated: define(): Declaration of case-insensiti= ve constants is deprecated in %s on line %d=0A define MAX succeeded; value = is >20<=0A define MY_PI succeeded; value is >3.1415926<=0A define MY_COLOR = succeeded; value is >red<=0A@@ -208,7 +206,9 @@ define #%& succeeded; value= is >200<=0A =0A Notice: Constant MY_COLOR already defined in %s/constants/= constants.php on line 13=0A define MY_COLOR failed; value is >red<=0A-defin= e TRUE succeeded; value is >999<=0A+=0A+Notice: Constant TRUE already defin= ed in %s/constants/constants.php on line 13=0A+define TRUE failed; value is= >1<=0A TRUE's value:1=0A define COLORS succeeded=0A Notice: Array to s= tring conversion in %s/constants/constants.php on line 16=0A