Is it possible to assert object's property type by string property name #10615
olexoliinyk0
started this conversation in
General
Replies: 1 comment 2 replies
-
No, it's not, write simpler code 😊 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's the "try" to demonstrate it. It works if you pass property by value, but does not if it's a dynamic property in a method. Thanks!
https://phpstan.org/r/55632b8b-f6f0-47f2-b29e-69cdf2fb8825
Beta Was this translation helpful? Give feedback.
All reactions