ConFoo Montreal 2026: Call for Papers

Voting

: two minus zero?
(Example: nine)

The Note You're Voting On

cl at viazenetti dot de
7 years ago
An other way to get all PHP errors that are set to be reported. This code will even work, when additional error types are added in future.

<?php
$pot
= 0;
foreach (
array_reverse(str_split(decbin(error_reporting()))) as $bit) {
if (
$bit == 1) {
echo
array_search(pow(2, $pot), get_defined_constants(true)['Core']). "<br>\n";
}
$pot++;
}
?>

<< Back to user notes page

To Top