-
Notifications
You must be signed in to change notification settings - Fork 711
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
Using PHP functions and static class methods in expressions now also triggers a deprecation notice #880
Conversation
…tice because we will drop support for this in the next major release Fixes #813
Just a quick question, the following code will be supported in the next version of Smarty or not?
Works with Smarty 4.3.4. Thanks |
Yes, Smarty 5 still supports the 'old' foreach syntax, @vojtasvoboda . |
The question was about calling the native PHP function range() (and also about other native PHP functions), sorry for the incomplete description :-) @wisskid
|
Well, my answer wasn't very complete either... :-) |
@wisskid But the range() function is not implemented in v4.3.4 either and works well (i didn't find any range mention in the whole repository) :-) I thought Smarty just call global functions (and also native PHP functions) without any extra definition. For example when I create a custom global function my_custom_strtoupper(string $name) and call:
It works. So in Smarty 5.x.x calling existing functions (and also native PHP functions) will be disabled? |
Yes, that is correct. @vojtasvoboda more specifically: you can still use them, but you'll have to register them first or include them in a custom extension. |
… be supported in v5
…nore them in tests by default.
…s/modifiers in v5
how to disabled this? |
You cannot and should not, but you can configure your error reporting and/or logging to ignore deprecation notices. |
Could you tell us what is the recommended way for accessing constants or class constants ? Same for static method call |
... because we will drop support for this in the next major release
Fixes #813