Skip to content

Commit 7936c80

Browse files
authored
Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385)
1 parent f8f7fd2 commit 7936c80

File tree

145 files changed

+563
-544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+563
-544
lines changed

Diff for: Zend/tests/011.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool(false)
8989
property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
9090
property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
9191
property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
92-
property_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given
92+
property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
9393
property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
9494
bool(true)
9595
bool(true)

Diff for: Zend/tests/024.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ var_dump($a->$b->{$c[1]});
1717
--EXPECTF--
1818
Warning: Undefined variable $a in %s on line %d
1919

20-
Warning: Trying to access array offset on value of type null in %s on line %d
20+
Warning: Trying to access array offset on null in %s on line %d
2121
NULL
2222

2323
Warning: Undefined variable $a in %s on line %d
2424

2525
Warning: Undefined variable $c in %s on line %d
2626

27-
Warning: Trying to access array offset on value of type null in %s on line %d
27+
Warning: Trying to access array offset on null in %s on line %d
2828
NULL
2929

3030
Warning: Undefined variable $a in %s on line %d
@@ -49,7 +49,7 @@ NULL
4949

5050
Warning: Undefined variable $c in %s on line %d
5151

52-
Warning: Trying to access array offset on value of type null in %s on line %d
52+
Warning: Trying to access array offset on null in %s on line %d
5353

5454
Warning: Attempt to read property "1" on int in %s on line %d
5555

Diff for: Zend/tests/033.phpt

+15-15
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,39 @@ try {
2727
--EXPECTF--
2828
Warning: Undefined variable $arr in %s on line %d
2929

30-
Warning: Trying to access array offset on value of type null in %s on line %d
30+
Warning: Trying to access array offset on null in %s on line %d
3131

32-
Warning: Trying to access array offset on value of type null in %s on line %d
32+
Warning: Trying to access array offset on null in %s on line %d
3333

34-
Warning: Trying to access array offset on value of type null in %s on line %d
34+
Warning: Trying to access array offset on null in %s on line %d
3535

36-
Warning: Trying to access array offset on value of type null in %s on line %d
36+
Warning: Trying to access array offset on null in %s on line %d
3737

38-
Warning: Trying to access array offset on value of type null in %s on line %d
38+
Warning: Trying to access array offset on null in %s on line %d
3939

4040
Warning: Undefined variable $arr in %s on line %d
4141

42-
Warning: Trying to access array offset on value of type null in %s on line %d
42+
Warning: Trying to access array offset on null in %s on line %d
4343

44-
Warning: Trying to access array offset on value of type null in %s on line %d
44+
Warning: Trying to access array offset on null in %s on line %d
4545

46-
Warning: Trying to access array offset on value of type null in %s on line %d
46+
Warning: Trying to access array offset on null in %s on line %d
4747

48-
Warning: Trying to access array offset on value of type null in %s on line %d
48+
Warning: Trying to access array offset on null in %s on line %d
4949

50-
Warning: Trying to access array offset on value of type null in %s on line %d
50+
Warning: Trying to access array offset on null in %s on line %d
5151

5252
Warning: Undefined variable $arr in %s on line %d
5353

54-
Warning: Trying to access array offset on value of type null in %s on line %d
54+
Warning: Trying to access array offset on null in %s on line %d
5555

56-
Warning: Trying to access array offset on value of type null in %s on line %d
56+
Warning: Trying to access array offset on null in %s on line %d
5757

58-
Warning: Trying to access array offset on value of type null in %s on line %d
58+
Warning: Trying to access array offset on null in %s on line %d
5959

60-
Warning: Trying to access array offset on value of type null in %s on line %d
60+
Warning: Trying to access array offset on null in %s on line %d
6161

62-
Warning: Trying to access array offset on value of type null in %s on line %d
62+
Warning: Trying to access array offset on null in %s on line %d
6363

6464
Warning: Attempt to read property "foo" on null in %s on line %d
6565
Attempt to assign property "foo" on null

Diff for: Zend/tests/assign_dim_obj_null_return.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ Cannot add element to the array as the next element is already occupied
7979
Illegal offset type
8080
Illegal offset type
8181
Cannot use a scalar value as an array
82-
Attempt to assign property "foo" on bool
83-
Attempt to assign property "foo" on bool
82+
Attempt to assign property "foo" on true
83+
Attempt to assign property "foo" on true

Diff for: Zend/tests/assign_to_var_003.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var_dump($var1);
1313
echo "Done\n";
1414
?>
1515
--EXPECTF--
16-
Warning: Trying to access array offset on value of type float in %s on line %d
16+
Warning: Trying to access array offset on float in %s on line %d
1717
NULL
1818
NULL
1919
Done

Diff for: Zend/tests/bug44660.phpt

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,22 @@ var_dump($a);
4848
?>
4949
--EXPECTF--
5050
--> read access:
51-
Warning: Attempt to read property "p" on bool in %s on line %d
51+
Warning: Attempt to read property "p" on true in %s on line %d
5252

5353
--> direct assignment:
54-
Attempt to assign property "p" on bool
54+
Attempt to assign property "p" on true
5555

5656
--> increment:
57-
Attempt to increment/decrement property "p" on bool
57+
Attempt to increment/decrement property "p" on true
5858

5959
--> reference assignment:
60-
Attempt to modify property "p" on bool
60+
Attempt to modify property "p" on true
6161

6262
--> reference assignment:
63-
Attempt to modify property "p" on bool
63+
Attempt to modify property "p" on true
6464

6565
--> indexed assignment:
66-
Attempt to modify property "p" on bool
66+
Attempt to modify property "p" on true
6767

6868
--> Confirm assignments have had no impact:
6969
bool(true)

Diff for: Zend/tests/bug81631.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var_dump($b::class);
88
--EXPECTF--
99
Warning: Undefined variable $b in %s on line 3
1010

11-
Fatal error: Uncaught TypeError: Cannot use "::class" on value of type null in %s:3
11+
Fatal error: Uncaught TypeError: Cannot use "::class" on null in %s:3
1212
Stack trace:
1313
#0 {main}
1414
thrown in %s on line 3

Diff for: Zend/tests/call_user_func_007.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var_dump($a);
1313
--EXPECTF--
1414
Warning: Undefined array key 0 in %s on line %d
1515

16-
Warning: Trying to access array offset on value of type null in %s on line %d
16+
Warning: Trying to access array offset on null in %s on line %d
1717

1818
Warning: foo(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
1919
array(0) {

Diff for: Zend/tests/class_on_constant_evaluated_expression.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ An error should be generated when using ::class on a constant evaluated expressi
77

88
?>
99
--EXPECTF--
10-
Fatal error: Cannot use "::class" on value of type int in %s on line %d
10+
Fatal error: Cannot use "::class" on int in %s on line %d

Diff for: Zend/tests/class_on_object.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ try {
2525
string(8) "stdClass"
2626
string(8) "stdClass"
2727
string(8) "stdClass"
28-
Cannot use "::class" on value of type null
28+
Cannot use "::class" on null

Diff for: Zend/tests/const_expr_dim_on_null_warning.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ const C = (null)['foo'];
66
var_dump(C);
77
?>
88
--EXPECTF--
9-
Warning: Trying to access array offset on value of type null in %s on line %d
9+
Warning: Trying to access array offset on null in %s on line %d
1010
NULL

Diff for: Zend/tests/dereference_002.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ array(2) {
7070
}
7171
int(1)
7272

73-
Warning: Trying to access array offset on value of type int in %s on line %d
73+
Warning: Trying to access array offset on int in %s on line %d
7474
NULL
7575

7676
Warning: Undefined array key 4 in %s on line %d

Diff for: Zend/tests/dereference_010.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ var_dump(b()[1]);
2121

2222
?>
2323
--EXPECTF--
24-
Warning: Trying to access array offset on value of type int in %s on line %d
24+
Warning: Trying to access array offset on int in %s on line %d
2525
NULL
2626

27-
Warning: Trying to access array offset on value of type int in %s on line %d
27+
Warning: Trying to access array offset on int in %s on line %d
2828
NULL
2929

3030
Fatal error: Uncaught Error: Cannot use object of type stdClass as array in %s:%d

Diff for: Zend/tests/dereference_014.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ var_dump($h);
2727

2828
?>
2929
--EXPECTF--
30-
Warning: Trying to access array offset on value of type null in %s on line %d
30+
Warning: Trying to access array offset on null in %s on line %d
3131

3232
Warning: Attempt to read property "a" on null in %s on line %d
3333
NULL
3434

35-
Warning: Trying to access array offset on value of type null in %s on line %d
35+
Warning: Trying to access array offset on null in %s on line %d
3636

3737
Warning: Attempt to read property "b" on null in %s on line %d
3838
NULL

Diff for: Zend/tests/isset_003.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Warning: Undefined variable $c in %s on line %d
3333

3434
Warning: Undefined variable $d in %s on line %d
3535

36-
Warning: Trying to access array offset on value of type null in %s on line %d
36+
Warning: Trying to access array offset on null in %s on line %d
3737

3838
Warning: Attempt to read property "" on string in %s on line %d
3939
bool(false)

Diff for: Zend/tests/nullsafe_operator/002.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ try {
3535

3636
?>
3737
--EXPECT--
38-
string(39) "Call to a member function bar() on bool"
38+
string(40) "Call to a member function bar() on false"
3939
string(40) "Call to a member function bar() on array"
4040
string(38) "Call to a member function bar() on int"
4141
string(40) "Call to a member function bar() on float"

Diff for: Zend/tests/offset_bool.phpt

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,30 @@ var_dump($bool[$arr]);
2525
echo "Done\n";
2626
?>
2727
--EXPECTF--
28-
Warning: Trying to access array offset on value of type bool in %s on line %d
28+
Warning: Trying to access array offset on true in %s on line %d
2929
NULL
3030

31-
Warning: Trying to access array offset on value of type bool in %s on line %d
31+
Warning: Trying to access array offset on true in %s on line %d
3232
NULL
3333

34-
Warning: Trying to access array offset on value of type bool in %s on line %d
34+
Warning: Trying to access array offset on true in %s on line %d
3535
NULL
3636

37-
Warning: Trying to access array offset on value of type bool in %s on line %d
37+
Warning: Trying to access array offset on true in %s on line %d
3838
NULL
3939

40-
Warning: Trying to access array offset on value of type bool in %s on line %d
40+
Warning: Trying to access array offset on true in %s on line %d
4141
NULL
4242

43-
Warning: Trying to access array offset on value of type bool in %s on line %d
43+
Warning: Trying to access array offset on true in %s on line %d
4444
NULL
4545

46-
Warning: Trying to access array offset on value of type bool in %s on line %d
46+
Warning: Trying to access array offset on true in %s on line %d
4747
NULL
4848

49-
Warning: Trying to access array offset on value of type bool in %s on line %d
49+
Warning: Trying to access array offset on true in %s on line %d
5050
NULL
5151

52-
Warning: Trying to access array offset on value of type bool in %s on line %d
52+
Warning: Trying to access array offset on true in %s on line %d
5353
NULL
5454
Done

Diff for: Zend/tests/offset_long.phpt

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,30 @@ var_dump($long[$arr]);
2525
echo "Done\n";
2626
?>
2727
--EXPECTF--
28-
Warning: Trying to access array offset on value of type int in %s on line %d
28+
Warning: Trying to access array offset on int in %s on line %d
2929
NULL
3030

31-
Warning: Trying to access array offset on value of type int in %s on line %d
31+
Warning: Trying to access array offset on int in %s on line %d
3232
NULL
3333

34-
Warning: Trying to access array offset on value of type int in %s on line %d
34+
Warning: Trying to access array offset on int in %s on line %d
3535
NULL
3636

37-
Warning: Trying to access array offset on value of type int in %s on line %d
37+
Warning: Trying to access array offset on int in %s on line %d
3838
NULL
3939

40-
Warning: Trying to access array offset on value of type int in %s on line %d
40+
Warning: Trying to access array offset on int in %s on line %d
4141
NULL
4242

43-
Warning: Trying to access array offset on value of type int in %s on line %d
43+
Warning: Trying to access array offset on int in %s on line %d
4444
NULL
4545

46-
Warning: Trying to access array offset on value of type int in %s on line %d
46+
Warning: Trying to access array offset on int in %s on line %d
4747
NULL
4848

49-
Warning: Trying to access array offset on value of type int in %s on line %d
49+
Warning: Trying to access array offset on int in %s on line %d
5050
NULL
5151

52-
Warning: Trying to access array offset on value of type int in %s on line %d
52+
Warning: Trying to access array offset on int in %s on line %d
5353
NULL
5454
Done

Diff for: Zend/tests/offset_null.phpt

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,30 @@ var_dump($null[$arr]);
2525
echo "Done\n";
2626
?>
2727
--EXPECTF--
28-
Warning: Trying to access array offset on value of type null in %s on line %d
28+
Warning: Trying to access array offset on null in %s on line %d
2929
NULL
3030

31-
Warning: Trying to access array offset on value of type null in %s on line %d
31+
Warning: Trying to access array offset on null in %s on line %d
3232
NULL
3333

34-
Warning: Trying to access array offset on value of type null in %s on line %d
34+
Warning: Trying to access array offset on null in %s on line %d
3535
NULL
3636

37-
Warning: Trying to access array offset on value of type null in %s on line %d
37+
Warning: Trying to access array offset on null in %s on line %d
3838
NULL
3939

40-
Warning: Trying to access array offset on value of type null in %s on line %d
40+
Warning: Trying to access array offset on null in %s on line %d
4141
NULL
4242

43-
Warning: Trying to access array offset on value of type null in %s on line %d
43+
Warning: Trying to access array offset on null in %s on line %d
4444
NULL
4545

46-
Warning: Trying to access array offset on value of type null in %s on line %d
46+
Warning: Trying to access array offset on null in %s on line %d
4747
NULL
4848

49-
Warning: Trying to access array offset on value of type null in %s on line %d
49+
Warning: Trying to access array offset on null in %s on line %d
5050
NULL
5151

52-
Warning: Trying to access array offset on value of type null in %s on line %d
52+
Warning: Trying to access array offset on null in %s on line %d
5353
NULL
5454
Done

Diff for: Zend/tests/prop_const_expr/basic_nullsafe.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Warning: Attempt to read property "test" on null in %s on line %d
3939
NULL
4040
NULL
4141

42-
Warning: Trying to access array offset on value of type null in %s on line %d
42+
Warning: Trying to access array offset on null in %s on line %d
4343
NULL
4444
NULL
4545
Printer

Diff for: Zend/tests/type_declarations/scalar_strict.phpt

+6-6
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ int(2147483647)
8484
*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
8585

8686
*** Trying bool(true)
87-
*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d
87+
*** Caught {closure}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
8888

8989
*** Trying bool(false)
90-
*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d
90+
*** Caught {closure}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
9191

9292
*** Trying NULL
9393
*** Caught {closure}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
@@ -137,10 +137,10 @@ float(2147483647)
137137
float(NAN)
138138

139139
*** Trying bool(true)
140-
*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d
140+
*** Caught {closure}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
141141

142142
*** Trying bool(false)
143-
*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d
143+
*** Caught {closure}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
144144

145145
*** Trying NULL
146146
*** Caught {closure}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
@@ -190,10 +190,10 @@ string(0) ""
190190
*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
191191

192192
*** Trying bool(true)
193-
*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d
193+
*** Caught {closure}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
194194

195195
*** Trying bool(false)
196-
*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d
196+
*** Caught {closure}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
197197

198198
*** Trying NULL
199199
*** Caught {closure}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d

0 commit comments

Comments
 (0)