Skip to content

Commit 64dd279

Browse files
committed
Fix more undefined constant uses
1 parent 5fc96c5 commit 64dd279

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

tests/functions/order_of_evaluation.phpt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function h($p1, $p2, $p3, $p4, $p5)
3434

3535
// Create a table of function designators
3636

37-
$funcTable = array(f, g, h); // list of 3 functions
38-
var_dump($funcTable); // array of 3 strings
39-
var_dump($funcTable[0]); // a string
37+
$funcTable = array("f", "g", "h"); // list of 3 functions
38+
var_dump($funcTable); // array of 3 strings
39+
var_dump($funcTable[0]); // a string
4040

4141
// Call all 3 functions indirectly through table
4242

@@ -52,12 +52,6 @@ $funcTable[$i++]($i, ++$i, $i, $i = 12, --$i); // function designator side effec
5252
// g: $p1 = 2, $p2 = 3, $p3 = 3, $p4 = 12, $p5 = 11
5353
--EXPECTF--
5454
f: $p1 = 0, $p2 = 1, $p3 = 1, $p4 = 12, $p5 = 11
55-
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
57-
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
59-
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
6155
array(3) {
6256
[0]=>
6357
string(1) "f"

tests/variables/variable_names.phpt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ${TRUE} = 104;
2525
${FALSE} = 105;
2626
${NULL} = 106;
2727

28-
${total} = 1000; // allowed after warning: Use of undefined constant total - assumed 'total'
28+
//${total} = 1000; // disallowed; undefined constant total
2929
//${t o tal} = 1000; // disallowed; ill-formed expression
3030
//${+} = 1000; // disallowed; ill-formed expression
3131
${10 + 4} = 1000; // allowed
@@ -53,9 +53,7 @@ print_globals();
5353
int(99)
5454
int(100)
5555
int(101)
56-
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
58-
array(12) {
56+
array(11) {
5957
["argc"]=>
6058
int(1)
6159
["v"]=>
@@ -70,8 +68,6 @@ array(12) {
7068
int(104)
7169
[""]=>
7270
int(106)
73-
["total"]=>
74-
int(1000)
7571
[14]=>
7672
int(1000)
7773
["abxy"]=>

0 commit comments

Comments
 (0)