-
Notifications
You must be signed in to change notification settings - Fork 99
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 error ~ passing null #205
Comments
Also (when debugging enabled)
|
Can you please confirm the line numbers against the current master version: |
Yes they're correct
|
More testing, have realized this error(s) occurs randomly and isn't related to debugging. It nevertheless generates the image, I have a script to retry after 1 s and it always works perfectly the second call.
|
If you have any insight as to what/where/how the null is being passed it would be helpful. |
What I can discern is it seems to be connected to to generation of a debug msg, but not a successful image output. Here is debug output of otherwise successful runs -
|
When debug is disabled, this is what happens. All cached images always return ok. It would be very hard to get a full debug output because I do not know in advance which will generate the problem, and as you can see the next time the same thumbnail is requested, it always returns ok immediately, so by definition it's not repeatable. Note the time measurements - nearly 4 secs before failing, 0.01 s to succeed, which suggests the image was processed and cached successfully the first time but for some reason did not get passed through.
So this is some fundamental issue, but as above these PHP errors of the OP appear to be just connected with any and all debug output. |
#208 should fix the issue in first comment. @badbadmonkey what happens is that since 8.x compiler throws warnings about using values which are not set. Those are sent before headers are set, so image is generated, but not visible as text was sent before headers. On second request code uses cached image - so code with warnings is not executed. Could be fixed by checking with A workaround would be to disable warnings with cc: @JamesHeinrich |
i suggest using !empty instead of isset, cause isset could return true while the value still being null (ie $example = null then you test with isset($example) and it will return true). |
PHP Version 8.1.13 warning ~
[] PHP Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /.../phpthumb/phpthumb.class.php on line 1990
The text was updated successfully, but these errors were encountered: