-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Casting TableCell value to string. #21430
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
PHP throws a catchable fatal error when the value from this method is used in strstr in the Table class.
Taking it strictly the current behaviour is not wing as the |
Looks like a feature to me, it is the expected behavior on 2.7. |
Mis-read the comment by @stof in symfony#21429
👍 on 2.7, minor tweak to me |
I would only cast for ints then. |
@jaydiablo Can you make the change @fabpot asked for? :) |
Sure, what about other numeric values that aren't ints? Like a float. Should we wrap the cast in something like: if (is_numeric($value) && !is_string($value)) { ? |
My point was that I don't want to have a cast to a string for objects for instance. |
Thank you @jaydiablo. |
This PR was squashed before being merged into the 2.7 branch (closes #21430). Discussion ---------- Casting TableCell value to string. | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21429 | License | MIT | Doc PR | PHP throws a catchable fatal error when the value from this method is used in strstr in the Table class. This fixes the error by casting to a string before returning the value. Commits ------- 1e5707f Casting TableCell value to string.
PHP throws a catchable fatal error when the value from this method is
used in strstr in the Table class. This fixes the error by casting to a string before returning the value.