Skip to content

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

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

Closed
mvorisek opened this issue Apr 8, 2022 · 2 comments · Fixed by #8385
Closed

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

mvorisek opened this issue Apr 8, 2022 · 2 comments · Fixed by #8385

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Apr 8, 2022

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) #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 mvorisek changed the title false type must be printed instead of bool false/true type must be printed instead of bool Apr 8, 2022
@mvorisek mvorisek changed the title false/true type must be printed instead of bool false/true type/value must be printed instead of bool Apr 8, 2022
@iluuu1994 iluuu1994 changed the title false/true type/value must be printed instead of bool Type error could print false/true type/value instead of bool Apr 8, 2022
@bwoebi
Copy link
Member

bwoebi commented Apr 9, 2022

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).

@mvorisek
Copy link
Contributor Author

mvorisek commented Apr 9, 2022

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

@kocsismate kocsismate self-assigned this Apr 16, 2022
kocsismate added a commit to kocsismate/php-src that referenced this issue Apr 16, 2022
kocsismate added a commit to kocsismate/php-src that referenced this issue Apr 16, 2022
kocsismate added a commit to kocsismate/php-src that referenced this issue Apr 16, 2022
kocsismate added a commit to kocsismate/php-src that referenced this issue Apr 16, 2022
kocsismate added a commit to kocsismate/php-src that referenced this issue Jan 21, 2023
kocsismate added a commit to kocsismate/php-src that referenced this issue Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants