Prado is not aware of changes to the error reporting level after the framework is loaded.
Assume error_reporting is set to E_ALL and you have a code like in any file (after prado ist started)
$a = array(0=>'0');
error_reporting(E_ALL & ~E_NOTICE);
echo "a[1]: ".$a[1];
The code above will cause an Notice to be created which shouldn't happen.
I think is caused by the following line:
set_error_handler(array('PradoBase','phpErrorHandler'),error_reporting());
Because the new errorhandler does not care the current reporting level when called (only if it is 0):
public static function phpErrorHandler($errno,$errstr,$errfile,$errline)
{
if(error_reporting()!=0)
throw new TPhpErrorException($errno,$errstr,$errfile,$errline);
}
One possible solution could be modifying phpErrorHandler to take care of the current error reporting level:
public static function phpErrorHandler($errno,$errstr,$errfile,$errline)
{
if(error_reporting() & $errno)
throw new TPhpErrorException($errno,$errstr,$errfile,$errline);
}
and register phpErrorHandler for
all errors:
set_error_handler(array('PradoBase','phpErrorHandler'));
Edit: added register phpErrorHandler for all errors.Greets acron