Skip to content

Instantly share code, notes, and snippets.

@robballou
Created March 10, 2010 15:24
Show Gist options
  • Save robballou/327975 to your computer and use it in GitHub Desktop.
Save robballou/327975 to your computer and use it in GitHub Desktop.
<?php
// convert the error reporting value to an array of constant values
// from: http://php.net/manual/en/function.error-reporting.php
$bit = ini_get('error_reporting');
$res = array();
while ($bit > 0) {
for($i = 0, $n = 0; $i <= $bit; $i = 1 * pow(2, $n), $n++) {
$end = $i;
}
$res[] = $end;
$bit = $bit - $end;
}
var_dump($res);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment