Class for converting PHP constants for error levels from integers to strings and vice-versa.
ErrorLevelCalculator::toString(32767);
This will return the string E_ALL
. It is also possible to construct more complicated examples such as:
ErrorLevelCalculator::toString(32765);
This will return E_ALL & ~E_WARNING
. In addition to this, they can be built as:
ErrorLevelCalculator::toString(3);
This would return E_ERROR | E_WARNING
.
The opposite of this is also true, the following:
ErrorLevelCalculator::toCode('E_ERROR | E_WARNING');
Would return 3
.