You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right. And I believe this also goes all to the logs even on production which is a problem when you have millions of unwanted notices and you don't want to spend months adapting legacy code (specially when it's not yours) or when having undefined variables is your coding style choice and the reason you love PHP.
BTW, there is a flame war in the PHP community regarding the imposed coding style since version 8:
About 40% of the developers considered it a bad decision, very disrespectful and/or that PHP's simplicity was destroyed. As a workaround, some developers suggested 1) to disable logging notices using error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT) and 2) to create your own error handler and ignore specific warnings that were previously handled as notices.
This workaround is not working in Peachpie, becauses 1) error_reporting didn't affect the logs and 2) it is ignoring the value returned by the error handler function, where returning true means "ignore the error completely and don't even log it".
My suggestion is to implement both to avoid forks, because even when 60% is bigger than 40%, that's not a reason to crash them (force them to rewrite their legacy code instead of simply solve it with a single configuration option).
Is there any option to ignore/hide the Notices (showing in VSCode debug window)?
This code should work:
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
The text was updated successfully, but these errors were encountered: