com php-langspec: Reflect changes for RFC: Deprecate and Remove Bareword (Unquoted) Strings: spec/07-variables.md spec/10-expressions.md
tests/functions/basics.phpt tests/functions/order_of_evalua tion.phpt tests/variables/variable_names.phpt

From: Date: Tue, 28 Mar 2017 22:28:22 +0000
Subject: com php-langspec: Reflect changes for RFC: Deprecate and Remove Bareword (Unquoted) Strings: spec/07-variables.md spec/10-expressions.md
tests/functions/basics.phpt tests/functions/order_of_evalua tion.phpt tests/variables/variable_names.phpt
Groups: php.standards.cvs 
Request: Send a blank email to standards--cvs+get-380@lists.php.net to get a copy of this message
Commit: 40ac5c13bc2fd35a09b76aed564f70cd062ac5c3 Author: Rowan Collins <rowan.collins@gmail.com> Sun, 5 Mar 2017 19:46:34 +0000 Committer: Nikita Popov <nikita.ppv@gmail.com> Wed, 29 Mar 2017 00:28:22 +0200 Parents: 22020fb79ec8f9a0cf33d947d5e0f76c38a86fb1 Branches: master Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=40ac5c13bc2fd35a09b76aed564f70cd062ac5c3 Log: Reflect changes for RFC: Deprecate and Remove Bareword (Unquoted) Strings https://wiki..php.net/rfc/deprecate-bareword-strings Changed paths: M spec/07-variables.md M spec/10-expressions.md M tests/functions/basics.phpt M tests/functions/order_of_evaluation.phpt M tests/variables/variable_names.phpt Diff: diff --git a/spec/07-variables.md b/spec/07-variables.md index 58fdf9e..990f0bc 100644 --- a/spec/07-variables.md +++ b/spec/07-variables.md @@ -52,7 +52,7 @@ and is a non-modifiable lvalue. 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. -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. +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. For class/interface constants: An exception of type [Error](14-classes.md#class-error) is thrown, stating that the corresponding constant was undefined. @@ -66,18 +66,18 @@ define('FAILURE', TRUE); // Examples of undefined constants echo NON_EXISTING_CONSTANT; // uses 'NON_EXISTING_CONSTANT' as substitution - // value and emits a notice stating that the + // value and emits a warning stating that the // constant was undefined. echo NON_EXISTING_CONSTANT; // same here, the constant is still undefined // and 'NON_EXISTING_CONSTANT' is used as - // substitution value and a notice is emitted + // substitution value and a warning is emitted // again. echo MAX_LENGTH; // same here due to a forward usage // (MAX_LENGTH is defined further below). // 'MAX_LENGTH' is used as substitution - // value and an notice is emitted. + // value and a warning is emitted. echo \NON_EXISTING_CONSTANT; // qualified use of undefined constant. Throws // an exception of type Error. diff --git a/spec/10-expressions.md b/spec/10-expressions.md index e90b47e..f886082 100644 --- a/spec/10-expressions.md +++ b/spec/10-expressions.md @@ -3540,7 +3540,7 @@ class Bar{ include 'include.php'; } } -echo X; // emits a notice: Use of undefined constant X ... +echo X; // emits a warning: Use of undefined constant X ... echo \foo\X; // same as above since the inclusion did not happen yet $bar = new Bar(); $bar->bar(); diff --git a/tests/functions/basics.phpt b/tests/functions/basics.phpt index 58bbc4b..c6d7ad6 100644 --- a/tests/functions/basics.phpt +++ b/tests/functions/basics.phpt @@ -82,12 +82,12 @@ echo strlen("abcedfg")."\n"; f1: # arguments passed is 0 NULL -Notice: Use of undefined constant f1 - assumed 'f1' in %s/functions/basics.php on line 30 +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 -Notice: Use of undefined constant f1 - assumed 'f1' in %s/functions/basics.php on line 31 +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 string(2) "f1" -Notice: Use of undefined constant f1 - assumed 'f1' in %s/functions/basics.php on line 32 +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 f1: # arguments passed is 0 f1: # arguments passed is 0 f1: # arguments passed is 1 @@ -107,7 +107,7 @@ f2: $p1 = 10, $p2 = 20 f2: $p1 = 10, $p2 = 20 5 squared = 25 -Notice: Use of undefined constant square - assumed 'square' in %s/functions/basics.php on line 74 +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 string(6) "square" float(5.29) 7 diff --git a/tests/functions/order_of_evaluation.phpt b/tests/functions/order_of_evaluation.phpt index f1ac1e7..220c2f4 100644 --- a/tests/functions/order_of_evaluation.phpt +++ b/tests/functions/order_of_evaluation.phpt @@ -53,11 +53,11 @@ $funcTable[$i++]($i, ++$i, $i, $i = 12, --$i); // function designator side effec --EXPECTF-- f: $p1 = 0, $p2 = 1, $p3 = 1, $p4 = 12, $p5 = 11 -Notice: Use of undefined constant f - assumed 'f' in %s/functions/order_of_evaluation.php on line 34 +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 -Notice: Use of undefined constant g - assumed 'g' in %s/functions/order_of_evaluation.php on line 34 +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 -Notice: Use of undefined constant h - assumed 'h' in %s/functions/order_of_evaluation.php on line 34 +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 array(3) { [0]=> string(1) "f" diff --git a/tests/variables/variable_names.phpt b/tests/variables/variable_names.phpt index e50b92b..26f467f 100644 --- a/tests/variables/variable_names.phpt +++ b/tests/variables/variable_names.phpt @@ -54,7 +54,7 @@ int(99) int(100) int(101) -Notice: Use of undefined constant total - assumed 'total' in %s/variables/variable_names.php on line 25 +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 array(12) { ["argc"]=> int(1)

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