-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Conversation
6ddd94c
to
4bef4d5
Compare
Not fully convinced of this change. Some of these error messages makes sense, like
while others don't, like
For error messages that explicitly mention "type" using |
Yeah, I agree. For this very example, I didn't notice that the new wording didn't make sense with the old message anymore, so I'll fix it up. For other messages where displaying true/false doesn't make sense (like the one I highlighted in a comment), my idea is to either revert the change, or to wait until |
https://3v4l.org/jvaCB |
True might be a native type but it remains a literal type i.e. a value within a type. So I'm sceptical of the improvement. |
I opened the #8329 issue to be able to better understand error messages, very often when I see This is also the case for object type - https://3v4l.org/XOZBB - specific passed class is displayed than just |
Sounds good to me - I see not reason to not be more specific when trivially possible (and a mere boolean is not leaking sensitive info on its own).
|
I've just pushed an update to the PR where:
|
Looks reasonable from a quick glance. Do you have an example where zend_zval_type_name is still used? (Hard to see absence of changes in a diff...) |
Mostly it's when we use "Value of type ..." in the message: Two other examples:
I guess some of these messages could also be changed in a way which suits the new literal types... but I'm not interested in doing more improvements in this area, so I'd let the possibility to someone else, unless there is a straightforward and consistent way to fix them. |
The test expectations of ext/opcache/tests/jit/fetch_dim_func_arg_002.phpt and ext/opcache/tests/opt/assign_op_001.phpt need to be adjusted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I used the new function everywhere where a the message is related to a value (usually an argument)
- I left the original message intact where the message is related to a type. […]
I like that. Thank you!
As
false
has recently became a type on its own andtrue
is is going to be one soon, we can now printfalse
/true
in error and debug messages instead of justbool
.