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.4 compatibility (deprecated) #508
Comments
Hi @clarkk |
You should just try to install PHP8.1.4 The log will be full of deprecated |
Hi @clarkk |
I get that, but in this case there are so many errors! The log size is several Mb after only a short time. Most of them because null is sent as parameter which now is deprecated |
Hi @clarkk Can you build some similar file with just the necessary calls so we can reproduce it and not just make obscur patches not understanding how users use this library ? |
@clarkk you can solve your issues by replacing passing NULL by an empty string. |
I receive the same deprecation notices on the following: [25-May-2022 02:00:37 America/Los_Angeles] PHP Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in \vendor\tecnickcom\tcpdf\tcpdf.php on line 6369 I know these could be avoided by passing an empty string from the source instead of NULL, however, updating tcpdf.php to properly handle being passed NULL would make TCPDF more resilient and would resolve the deprecation notices with the least amount of code correction. |
Can you mention what code lines you are talking about or send a PR ? |
I'm sorry, I'm not really set up for PRs. But here are the lines I'm talking about: File: /tcpdf/tcpdf.php Line: 5154
Line: 6369
Line: 7636
|
In case of the first two, you'll still have a deprecated error if $txt has a value but is not a string. Better:
and
As for line 7636: if |
Hello, I have corrected myself the TCPDF code but I agree it would be nice to have a fix for all these PHP > 8.1 depreciation errors. |
Have just downloaded latest master and get this warning
The text was updated successfully, but these errors were encountered: