Improve type error messages when an object is given#5625
Closed
kocsismate wants to merge 3 commits into
Closed
Conversation
kocsismate
commented
May 25, 2020
Member
Author
There was a problem hiding this comment.
I wasn't exactly sure that I can use zend_zval_type_name() for this purpose (although it seems likely for me) so I introduced this one.
Member
Author
There was a problem hiding this comment.
It seems that phpdbg_info.c remained the only client of zend_zval_type_name() about which I'm not sure if I could use the new semantics.
Member
There was a problem hiding this comment.
I'm okay with reusing zend_zval_type_name for this and switching that phpdbg use to zend_get_type_by_const.
597899b to
97ff6ca
Compare
nikic
approved these changes
May 26, 2020
Additionally, make the format of return type errors match the format of argument errors.
97ff6ca to
6425fd0
Compare
6425fd0 to
e978343
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From now on, we always display the given object's type instead of just reporting
object. As suggested by Nikita in #5620 (comment)Additionally, I made the format of return type errors match the format of argument errors. I can revert this change easily if it's not desirable.