Reputation: 15
the following part of my code worked fine under PHP7.0:
if (Config::LOG_LEVEL == 'debug' | 'basic' | 'light') {}
I have now updated to PHP7.2 and the following error message appears:
A non-numeric value encountered
does anyone have any idea how i can fix this bug?
Upvotes: 0
Views: 474
Reputation: 352
As commented by others already, the code won't work as expected (usage of bitwise operator). Try in_array()
instead.
in_array(Config::LOG_LEVEL, ['debug', 'basic', 'light'])
Upvotes: 1