Skip to content

Commit ea03278

Browse files
committed
Case-insensitive constants are deprecated
1 parent bbbcec6 commit ea03278

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: spec/06-constants.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Specifically:
1414
name while that for a d-constant can contain any source character.
1515
- The name of a c-constant is case-sensitive while that for a
1616
d-constant can be case-sensitive or case-insensitive based on the
17-
value of the third argument passed to `define`.
17+
value of the third argument passed to `define`. The definition of
18+
case-insensitive constants is deprecated.
1819
- If `define` is able to define the given name, it returns `TRUE`;
1920
otherwise, it returns `FALSE`.
2021

@@ -30,7 +31,7 @@ string.
3031
```PHP
3132
const MAX_HEIGHT = 10.5; // define two (case-sensitive) c-constants
3233
const UPPER_LIMIT = MAX_HEIGHT;
33-
define('COEFFICIENT_1', 2.345, TRUE); // define a case-insensitive d-constant
34+
define('COEFFICIENT_1', 2.345, TRUE); // define a case-insensitive d-constant (deprecated)
3435
define('FAILURE', FALSE, FALSE); // define a case-sensitive d-constant
3536
```
3637

Diff for: tests/constants/constants.phpt

+2
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ 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
187189
define MAX succeeded; value is >20<
188190
define MY_PI succeeded; value is >3.1415926<
189191
define MY_COLOR succeeded; value is >red<

0 commit comments

Comments
 (0)