Skip to content
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

sprintf() does not accept objects with __toString() #1090

Closed
Majkl578 opened this issue Jun 24, 2018 · 2 comments
Closed

sprintf() does not accept objects with __toString() #1090

Majkl578 opened this issue Jun 24, 2018 · 2 comments

Comments

@Majkl578
Copy link
Contributor

Summary of a problem or a feature request

sprintf() should work with stringable objects as well.

Code snippet that reproduces the problem

https://phpstan.org/r/e1e38e6623cdcea50b0882ec7cebafd9

Expected output

no error, object is casted to string using __toString()
https://3v4l.org/m1cHp

@Jean85
Copy link
Contributor

Jean85 commented Jun 27, 2018

This is similar/related to #323, see #323 (comment)

@ondrejmirtes
Copy link
Member

Fixed: 5297029

@lock lock bot locked as resolved and limited conversation to collaborators Dec 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants