php-src icon indicating copy to clipboard operation
php-src copied to clipboard

Type error could print `false`/`true` type/value instead of `bool`

Open mvorisek opened this issue 4 years ago • 2 comments

Description

https://3v4l.org/av8Mi

since https://wiki.php.net/rfc/null-false-standalone-types PHP already standalone supports false type

starting with (if accepted) https://github.com/php/php-src/pull/8326 true as a standalone type will be supported as well

This is a feature request to improve the error messages with more specific type to help the developer understand the real given value.

So instead of:

Argument #1 ($obj) must be of type object, bool given,

the following should be printed:

Argument #1 ($obj) must be of type object, false given,

mvorisek avatar Apr 08 '22 18:04 mvorisek

I think that's pretty resonable. At least for the binary boolean which has not much information which can "leak" in error messages (unlick if you were to dump the string contents for example).

bwoebi avatar Apr 09 '22 01:04 bwoebi

yes, this issue is solely for true / false dump instead of bool

mvorisek avatar Apr 09 '22 06:04 mvorisek