- version_compare: documentation ( source)
- constant: documentation ( source)
<?php
$nonfatal = array(
E_USER_WARNING => true,
E_WARNING => true,
E_USER_NOTICE => true,
E_NOTICE => true,
E_STRICT => true,
);
if ( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) {
// wrapper `constant( 'XXX' )` is used to avoid compile notices
// on earlier PHP versions.
$nonfatal[constant( 'E_DEPRECATED' )] = true;
$nonfatal[constant( 'E_USER_DEPRECATED') ] = true;
}