Skip to content

Commit 231e649

Browse files
committed
Case-insensitive constants are no longer supported
1 parent 64dd279 commit 231e649

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

spec/06-constants.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ Specifically:
1212

1313
- The name of a c-constant must comply with the lexical grammar for a
1414
name while that for a d-constant can contain any source character.
15-
- The name of a c-constant is case-sensitive while that for a
16-
d-constant can be case-sensitive or case-insensitive based on the
17-
value of the third argument passed to `define`. The definition of
18-
case-insensitive constants is deprecated.
1915
- If `define` is able to define the given name, it returns `TRUE`;
2016
otherwise, it returns `FALSE`.
2117

tests/constants/constants.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ PHP Spec test generated from ./constants/constants.php
1111

1212
error_reporting(-1);
1313

14-
function trace($name, $value, $b = FALSE)
14+
function trace($name, $value)
1515
{
16-
$r = define($name, $value, $b);
16+
$r = define($name, $value);
1717
echo "define $name " . ($r ? "succeeded" : "failed");
1818
if (defined($name))
1919
echo "; value is >" . constant($name) . "<\n";
@@ -26,7 +26,7 @@ function trace($name, $value, $b = FALSE)
2626

2727
trace("STATUS1", TRUE);
2828
trace("MIN", 10);
29-
trace("MAX", 20, TRUE); // HHVM Warning: Case insensitive constant names are not supported in HipHop
29+
trace("MAX", 20);
3030
trace("MY_PI", 3.1415926);
3131
trace("MY_COLOR", "red");
3232
trace("C1", NULL);
@@ -184,8 +184,6 @@ echo "CON1: " . C3::CON1 . "\n"; // use :: notation, as a const is implicitly st
184184
--EXPECTF--
185185
define STATUS1 succeeded; value is >1<
186186
define MIN succeeded; value is >10<
187-
188-
Deprecated: define(): Declaration of case-insensitive constants is deprecated in %s on line %d
189187
define MAX succeeded; value is >20<
190188
define MY_PI succeeded; value is >3.1415926<
191189
define MY_COLOR succeeded; value is >red<
@@ -208,7 +206,9 @@ define #%& succeeded; value is >200<
208206

209207
Notice: Constant MY_COLOR already defined in %s/constants/constants.php on line 13
210208
define MY_COLOR failed; value is >red<
211-
define TRUE succeeded; value is >999<
209+
210+
Notice: Constant TRUE already defined in %s/constants/constants.php on line 13
211+
define TRUE failed; value is >1<
212212
TRUE's value:1
213213
define COLORS succeeded
214214
Notice: Array to string conversion in %s/constants/constants.php on line 16

0 commit comments

Comments
 (0)