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
Hi @mkluczka,
To me it looks like the bitwise and operator is correct.
The error_reporting() function returns the current error reporting level which is a bit field. The $code parameter is the level of the error raised. So the if statement checks if the specific reporting level is enabled by doing the bitwise and operation.
If your warning is ignored by the if statement, you're current error reporting level probably doesn't include the E_WARNING level.
You can change it via the php.ini file by setting error_reporting = E_ALL or at runtime via by calling error_reporting(E_ALL);.
You can find the different error levels here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've been doing some debugging with Yii2, and found out my warning is silenced by this error handler
https://github.com/yiisoft/yii2/blob/master/framework/base/ErrorHandler.php#L248
what is the purpose of bitwise operator used here? Or maybe it was supposed to be
&&?Beta Was this translation helpful? Give feedback.
All reactions