Skip to content

Properly handle reference return value from __toString()#18810

Closed
ndossche wants to merge 1 commit into
php:masterfrom
ndossche:handle-ref-tostring
Closed

Properly handle reference return value from __toString()#18810
ndossche wants to merge 1 commit into
php:masterfrom
ndossche:handle-ref-tostring

Conversation

@ndossche
Copy link
Copy Markdown
Member

@ndossche ndossche commented Jun 9, 2025

It's possible to return a reference from __toString(), but this is not handled and results in a (confusing) error telling that the return value must be a string.
Properly handle this by unwrapping the reference.

It's possible to return a reference from __toString(), but this is not
handled and results in a (confusing) error telling that the return value
must be a string.
Properly handle this by unwrapping the reference.
@ndossche ndossche closed this in eb151e3 Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants