-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Imply UTF8 validity in implode function #10780
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
5d68416
to
3f9aab5
Compare
3f9aab5
to
fa3a358
Compare
fa3a358
to
587ae73
Compare
I think doing this for implode makes sense, and the implode changes look correct. As for the dup case: I don't know if we should do that, if code that uses dup modifies the string and is not prepared for flag handling this could cause issues. |
makes sense, thank you, reverted at least from this PR |
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 believe your changes make sense and are correct.
I'll keep this open for a few more days to see if any other feedback comes in.
If no feedback comes in anymore, I'll merge it in a few days.
Thank you for your contribution!
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.
Looking at the special handling of int
types (which looks like some sort of optimization) I'm expecting: var_dump(implode("a", ["HELLO", 5, "WORLD", 9, "WTF"]));
to not be marked as a UTF-8 string.
I think the easiest way would be to yank the special IS_LONG handling away and just always go through the else branch.
improve #10463