Skip to content

Commit 40ac5c1

Browse files
IMSoPnikic
authored andcommitted
Reflect changes for RFC: Deprecate and Remove Bareword (Unquoted) Strings
https://wiki.php.net/rfc/deprecate-bareword-strings
1 parent 22020fb commit 40ac5c1

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

spec/07-variables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ and is a non-modifiable lvalue.
5252

5353
Undefined constants are not defined implicitly -- forward usages of constants are also classified as undefined constants here. A distinction between class/interface constants and top level constants is made.
5454

55-
For top level constants: For unqualified usages, the name of the undefined constant (as string) is used as substitution value. Moreover, a notice is emitted stating that the corresponding constant was undefined. For qualified usages, an exception of type [`Error`](14-classes.md#class-error) is thrown.
55+
For top level constants: For unqualified usages, the name of the undefined constant (as string) is used as substitution value. Moreover, a warning is emitted stating that the corresponding constant was undefined. For qualified usages, an exception of type [`Error`](14-classes.md#class-error) is thrown.
5656

5757
For class/interface constants: An exception of type [`Error`](14-classes.md#class-error) is thrown, stating that the corresponding constant was undefined.
5858

@@ -66,18 +66,18 @@ define('FAILURE', TRUE);
6666

6767
// Examples of undefined constants
6868
echo NON_EXISTING_CONSTANT; // uses 'NON_EXISTING_CONSTANT' as substitution
69-
// value and emits a notice stating that the
69+
// value and emits a warning stating that the
7070
// constant was undefined.
7171

7272
echo NON_EXISTING_CONSTANT; // same here, the constant is still undefined
7373
// and 'NON_EXISTING_CONSTANT' is used as
74-
// substitution value and a notice is emitted
74+
// substitution value and a warning is emitted
7575
// again.
7676

7777
echo MAX_LENGTH; // same here due to a forward usage
7878
// (MAX_LENGTH is defined further below).
7979
// 'MAX_LENGTH' is used as substitution
80-
// value and an notice is emitted.
80+
// value and a warning is emitted.
8181

8282
echo \NON_EXISTING_CONSTANT; // qualified use of undefined constant. Throws
8383
// an exception of type Error.

spec/10-expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3540,7 +3540,7 @@ class Bar{
35403540
include 'include.php';
35413541
}
35423542
}
3543-
echo X; // emits a notice: Use of undefined constant X ...
3543+
echo X; // emits a warning: Use of undefined constant X ...
35443544
echo \foo\X; // same as above since the inclusion did not happen yet
35453545
$bar = new Bar();
35463546
$bar->bar();

tests/functions/basics.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ echo strlen("abcedfg")."\n";
8282
f1: # arguments passed is 0
8383
NULL
8484

85-
Notice: Use of undefined constant f1 - assumed 'f1' in %s/functions/basics.php on line 30
85+
Warning: Use of undefined constant f1 - assumed 'f1' (this will throw an Error in a future version of PHP) in %s/functions/basics.php on line 30
8686

87-
Notice: Use of undefined constant f1 - assumed 'f1' in %s/functions/basics.php on line 31
87+
Warning: Use of undefined constant f1 - assumed 'f1' (this will throw an Error in a future version of PHP) in %s/functions/basics.php on line 31
8888
string(2) "f1"
8989

90-
Notice: Use of undefined constant f1 - assumed 'f1' in %s/functions/basics.php on line 32
90+
Warning: Use of undefined constant f1 - assumed 'f1' (this will throw an Error in a future version of PHP) in %s/functions/basics.php on line 32
9191
f1: # arguments passed is 0
9292
f1: # arguments passed is 0
9393
f1: # arguments passed is 1
@@ -107,7 +107,7 @@ f2: $p1 = 10, $p2 = 20
107107
f2: $p1 = 10, $p2 = 20
108108
5 squared = 25
109109

110-
Notice: Use of undefined constant square - assumed 'square' in %s/functions/basics.php on line 74
110+
Warning: Use of undefined constant square - assumed 'square' (this will throw an Error in a future version of PHP) in %s/functions/basics.php on line 74
111111
string(6) "square"
112112
float(5.29)
113113
7

tests/functions/order_of_evaluation.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ $funcTable[$i++]($i, ++$i, $i, $i = 12, --$i); // function designator side effec
5353
--EXPECTF--
5454
f: $p1 = 0, $p2 = 1, $p3 = 1, $p4 = 12, $p5 = 11
5555
56-
Notice: Use of undefined constant f - assumed 'f' in %s/functions/order_of_evaluation.php on line 34
56+
Warning: Use of undefined constant f - assumed 'f' (this will throw an Error in a future version of PHP) in %s/functions/order_of_evaluation.php on line 34
5757

58-
Notice: Use of undefined constant g - assumed 'g' in %s/functions/order_of_evaluation.php on line 34
58+
Warning: Use of undefined constant g - assumed 'g' (this will throw an Error in a future version of PHP) in %s/functions/order_of_evaluation.php on line 34
5959

60-
Notice: Use of undefined constant h - assumed 'h' in %s/functions/order_of_evaluation.php on line 34
60+
Warning: Use of undefined constant h - assumed 'h' (this will throw an Error in a future version of PHP) in %s/functions/order_of_evaluation.php on line 34
6161
array(3) {
6262
[0]=>
6363
string(1) "f"

tests/variables/variable_names.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int(99)
5454
int(100)
5555
int(101)
5656

57-
Notice: Use of undefined constant total - assumed 'total' in %s/variables/variable_names.php on line 25
57+
Warning: Use of undefined constant total - assumed 'total' (this will throw an Error in a future version of PHP) in %s/variables/variable_names.php on line 25
5858
array(12) {
5959
["argc"]=>
6060
int(1)

0 commit comments

Comments
 (0)