Draft
Conversation
Thus removing smart_str_append_const()
There isn't really a need for using the printf variant here
devnexen
reviewed
Mar 11, 2026
| { | ||
| smart_str_append_ex(dest, src, false); | ||
| } | ||
| #define smart_str_append_literal(dest, src) smart_str_appendl_ex(dest, "" src, sizeof(src)-1, false); |
Member
There was a problem hiding this comment.
nit: it might be best to remove the trailing ;
devnexen
reviewed
Mar 11, 2026
| smart_str_appends(str, "[unknown]"); \ | ||
| } else { \ | ||
| smart_str_appends(str, Z_STRVAL_P(tmp)); \ | ||
| smart_str_append(str, Z_STR_P(tmp)); \ |
Member
There was a problem hiding this comment.
"The devil is in the details". I think this little change causes all sort of problems, i.e. strlen() usage vs ZSTR_LEN()
devnexen
reviewed
Mar 11, 2026
| uint32_t *guard = zend_get_recursion_guard(zobj); | ||
| zend_string *class_name = Z_OBJ_HANDLER_P(expr, get_class_name)(zobj); | ||
| smart_str_appends(buf, ZSTR_VAL(class_name)); | ||
| smart_str_append(buf, class_name); |
devnexen
reviewed
Mar 11, 2026
| smart_str_appends(str, ZSTR_VAL(class_name)); | ||
| smart_str_appends(str, "), "); | ||
| smart_str_append_literal(str, "Object("); | ||
| smart_str_append(str, class_name); |
Member
|
Just using smart_str_appends should be good enough because the strlen will be computed at compile time for literals |
Member
Author
Yeah I wasn't sure about the literal version, happy to just use |
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.
Commits should be reviewed individually.