Skip to content

Fix GH-8329 Print true/false instead of bool in error and debug messages #8385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/tests/011.phpt
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ bool(false)
property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given
property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given
property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given
property_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given
property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given
property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
bool(true)
bool(true)
6 changes: 3 additions & 3 deletions Zend/tests/024.phpt
Original file line number Diff line number Diff line change
@@ -17,14 +17,14 @@ var_dump($a->$b->{$c[1]});
--EXPECTF--
Warning: Undefined variable $a in %s on line %d

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

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

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

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

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

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

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

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

30 changes: 15 additions & 15 deletions Zend/tests/033.phpt
Original file line number Diff line number Diff line change
@@ -27,39 +27,39 @@ try {
--EXPECTF--
Warning: Undefined variable $arr in %s on line %d

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Warning: Attempt to read property "foo" on null in %s on line %d
Attempt to assign property "foo" on null
4 changes: 2 additions & 2 deletions Zend/tests/assign_dim_obj_null_return.phpt
Original file line number Diff line number Diff line change
@@ -79,5 +79,5 @@ Cannot add element to the array as the next element is already occupied
Illegal offset type
Illegal offset type
Cannot use a scalar value as an array
Attempt to assign property "foo" on bool
Attempt to assign property "foo" on bool
Attempt to assign property "foo" on true
Attempt to assign property "foo" on true
2 changes: 1 addition & 1 deletion Zend/tests/assign_to_var_003.phpt
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECTF--
Warning: Trying to access array offset on value of type float in %s on line %d
Warning: Trying to access array offset on float in %s on line %d
NULL
NULL
Done
12 changes: 6 additions & 6 deletions Zend/tests/bug44660.phpt
Original file line number Diff line number Diff line change
@@ -48,22 +48,22 @@ var_dump($a);
?>
--EXPECTF--
--> read access:
Warning: Attempt to read property "p" on bool in %s on line %d
Warning: Attempt to read property "p" on true in %s on line %d

--> direct assignment:
Attempt to assign property "p" on bool
Attempt to assign property "p" on true

--> increment:
Attempt to increment/decrement property "p" on bool
Attempt to increment/decrement property "p" on true

--> reference assignment:
Attempt to modify property "p" on bool
Attempt to modify property "p" on true

--> reference assignment:
Attempt to modify property "p" on bool
Attempt to modify property "p" on true

--> indexed assignment:
Attempt to modify property "p" on bool
Attempt to modify property "p" on true

--> Confirm assignments have had no impact:
bool(true)
2 changes: 1 addition & 1 deletion Zend/tests/bug81631.phpt
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ var_dump($b::class);
--EXPECTF--
Warning: Undefined variable $b in %s on line 3

Fatal error: Uncaught TypeError: Cannot use "::class" on value of type null in %s:3
Fatal error: Uncaught TypeError: Cannot use "::class" on null in %s:3
Stack trace:
#0 {main}
thrown in %s on line 3
2 changes: 1 addition & 1 deletion Zend/tests/call_user_func_007.phpt
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ var_dump($a);
--EXPECTF--
Warning: Undefined array key 0 in %s on line %d

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

Warning: foo(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
array(0) {
2 changes: 1 addition & 1 deletion Zend/tests/class_on_constant_evaluated_expression.phpt
Original file line number Diff line number Diff line change
@@ -7,4 +7,4 @@ An error should be generated when using ::class on a constant evaluated expressi

?>
--EXPECTF--
Fatal error: Cannot use "::class" on value of type int in %s on line %d
Fatal error: Cannot use "::class" on int in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/class_on_object.phpt
Original file line number Diff line number Diff line change
@@ -25,4 +25,4 @@ try {
string(8) "stdClass"
string(8) "stdClass"
string(8) "stdClass"
Cannot use "::class" on value of type null
Cannot use "::class" on null
2 changes: 1 addition & 1 deletion Zend/tests/const_expr_dim_on_null_warning.phpt
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@ const C = (null)['foo'];
var_dump(C);
?>
--EXPECTF--
Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL
2 changes: 1 addition & 1 deletion Zend/tests/dereference_002.phpt
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ array(2) {
}
int(1)

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Undefined array key 4 in %s on line %d
4 changes: 2 additions & 2 deletions Zend/tests/dereference_010.phpt
Original file line number Diff line number Diff line change
@@ -21,10 +21,10 @@ var_dump(b()[1]);

?>
--EXPECTF--
Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Fatal error: Uncaught Error: Cannot use object of type stdClass as array in %s:%d
4 changes: 2 additions & 2 deletions Zend/tests/dereference_014.phpt
Original file line number Diff line number Diff line change
@@ -27,12 +27,12 @@ var_dump($h);

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

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

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

Warning: Attempt to read property "b" on null in %s on line %d
NULL
2 changes: 1 addition & 1 deletion Zend/tests/isset_003.phpt
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ Warning: Undefined variable $c in %s on line %d

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

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

Warning: Attempt to read property "" on string in %s on line %d
bool(false)
2 changes: 1 addition & 1 deletion Zend/tests/nullsafe_operator/002.phpt
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ try {

?>
--EXPECT--
string(39) "Call to a member function bar() on bool"
string(40) "Call to a member function bar() on false"
string(40) "Call to a member function bar() on array"
string(38) "Call to a member function bar() on int"
string(40) "Call to a member function bar() on float"
18 changes: 9 additions & 9 deletions Zend/tests/offset_bool.phpt
Original file line number Diff line number Diff line change
@@ -25,30 +25,30 @@ var_dump($bool[$arr]);
echo "Done\n";
?>
--EXPECTF--
Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL

Warning: Trying to access array offset on value of type bool in %s on line %d
Warning: Trying to access array offset on true in %s on line %d
NULL
Done
18 changes: 9 additions & 9 deletions Zend/tests/offset_long.phpt
Original file line number Diff line number Diff line change
@@ -25,30 +25,30 @@ var_dump($long[$arr]);
echo "Done\n";
?>
--EXPECTF--
Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL

Warning: Trying to access array offset on value of type int in %s on line %d
Warning: Trying to access array offset on int in %s on line %d
NULL
Done
18 changes: 9 additions & 9 deletions Zend/tests/offset_null.phpt
Original file line number Diff line number Diff line change
@@ -25,30 +25,30 @@ var_dump($null[$arr]);
echo "Done\n";
?>
--EXPECTF--
Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL
Done
2 changes: 1 addition & 1 deletion Zend/tests/prop_const_expr/basic_nullsafe.phpt
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ Warning: Attempt to read property "test" on null in %s on line %d
NULL
NULL

Warning: Trying to access array offset on value of type null in %s on line %d
Warning: Trying to access array offset on null in %s on line %d
NULL
NULL
Printer
12 changes: 6 additions & 6 deletions Zend/tests/type_declarations/scalar_strict.phpt
Original file line number Diff line number Diff line change
@@ -84,10 +84,10 @@ int(2147483647)
*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d

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

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

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

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

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

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

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

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

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