- defined: documentation ( source)
- restore_error_handler: documentation ( source)
- set_error_handler: documentation ( source)
- constant: documentation ( source)
<?php
function isDeprecated($c){
$d=false;
set_error_handler(function($e) use (&$d) {
$d = E_DEPRECATED === $e;
});
defined($c) && constant($c);
restore_error_handler();
return $d;
}
echo '`E_STRICT` is ' . (
!defined('E_STRICT') ? 'not defined' : (
isDeprecated('E_STRICT') ? 'deprecated' : (
E_STRICT === (E_ALL & E_STRICT) ? 'in `E_ALL`' : 'not in `E_ALL`'
)
)
);