-
Notifications
You must be signed in to change notification settings - Fork 254
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
[3.0] & [2.1]: Deprecated: Passing E_USER_ERROR to trigger_error() is deprecated since 8.4 #8402
Comments
Sharing some thoughts here. There are a lot of these throughout the code... They appear to fall into two categories: Cat1: Improper internal calls; these are intended to let devs know they massively screwed up calling a function Cat1a - An example of a bad params: SMF/Sources/Subs-Categories.php Line 238 in b52a4ab
Cat1b - Similar, but a step removed (don't want to miss these): Line 274 in b52a4ab
Cat2 - Is intended to force a hard exit: Line 716 in b52a4ab
Line 146 in b52a4ab
Note the the Drupal guys did a simple substitution of all E_USER_ERROR to E_USER_WARNING:
So... 2.1 PROPOSAL: For 2.1, I propose we do similar... For all Cat1 examples, downgrade E_USER_ERROR to E_USER_WARNING. Change all Cat2 calls to exit(). The point of this change appears to be to start to force folks to use try/throw/catch universally & develop a more robust universal error handler that can handle anything from user warnings to the Cat1 & Cat2 examples above. 3.0 may even be 100% towards a "ONE TRUE HANDLER" already (which is pretty impressive, IMO)... 3.0 PROPOSAL: For 3.0, for all Cat1 examples, downgrade E_USER_ERROR to E_USER_WARNING. That may be all that is necessary. I don't think Cat2 exists anymore. See also #8343 which I think is still a significant issue in 3.0 error handling, though. |
For 3.0, why not move to a throw? |
That would work. I'm not sure if there is any benefit to throw over trigger_error()? Although it does feel like the 8.4 deprecations indicate a direction away from trigger_error()... |
Basic Information
I've seen this error when doing some testing of a custom script...
Although it was a custom script, this one felt like it needed to be passed on...
Deprecated: Passing E_USER_ERROR to trigger_error() is deprecated since 8.4, throw an exception or call exit with a string message instead in yada\yada\Subs-Db-mysql.php on line 936
Steps to reproduce
Expected result
No response
Actual result
No response
Version/Git revision
3.0 Alpha 2 - current GH & 2.1
Database Engine
All
Database Version
8.4
PHP Version
8.4
Logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: