-
Notifications
You must be signed in to change notification settings - Fork 710
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
PHP 8.1: Deprecation notices for several functions in Smarty 3 and 4 #750
Comments
@alexgit2k thanks for the detailed report. Could I tempt you to make a PR for Smarty 4? |
For those who needs quick workaround(like me), you can temporarily silence deprecation errors:
This should be enough for now. |
One more related issue:
Gives:
|
There seems to be a few fixes here awaiting review and merging. Anything we can do to help speed up the process? |
Same for |regex_replace param #3, possible fix is an elseif empty
|
There are several deprecation-notices with PHP 8.1 in Smarty 3 and 4:
explode
: Passing null to parameternumber_format
: Passing null to parameterescape
: Passing null to parameter (see htmlspecialchars() - Deprecation warning in php 8.1 #748)date_format
: strftime() is deprecated (see strftime deprecated in PHP 8.1 #672)replace
: Passing null to parameterExample
Same deprecation notices with Smarty 4:
composer require smarty/smarty
No deprecation notices with PHP 8.0:
docker run -it --rm php:8.0 /bin/bash
Output
{$value|escape} → htmlspecialchars($value, ENT_QUOTES, 'UTF-8', true);
Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in compiled template on line 18
{count(";"|explode:$value)} → explode(";",$value);
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in compiled template on line 18
{$value|number_format} → number_format($value);
Deprecated: number_format(): Passing null to parameter #1 ($num) of type float is deprecated in compiled template on line 18
{$smarty.now|date_format} -> strftime($format, $timestamp);
Deprecated: Function strftime() is deprecated in /vendor/smarty/smarty/libs/plugins/modifier.date_format.php on line 81
{$value|replace:"":""} -> mb_split(preg_quote($search), $subject);
Deprecated: mb_split(): Passing null to parameter #2 ($string) of type string is deprecated in /vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php on line 47
The text was updated successfully, but these errors were encountered: