-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Math operations with non-numeric strings in PHP8 causes fatal error #3454
Comments
This is expected behaviour since PHP 8.0. |
Yes, I know that, but Twig probably should protect from these errors, and it is hard to find source of error by |
Well, adding type checks around each arithmetic operation in compiled twig templates will affect performance for all templates. Note that if you configure the Twig cache for compiled templates, the compiled templates won't be eval'ed anymore but loaded from the cache folder, which makes the stack trace easier to analyze (as you can open the file in the cache folder to see which template is in it) |
Closing as I don't think there is anything we can do. |
In PHP8 conversion of non-numeric string to number is considered fatal error.
Following example will throw a fatal error:
file.php
template.html.twig
Result:
The text was updated successfully, but these errors were encountered: