When using error_reporting()
or ini_set('error_reporting')
in my scripts, are there any functionality differences between the two? Is one method preferred over the other?
For what it's worth, I see many frameworks using error_reporting()
, but both options appear to be set during runtime only, then reset back to their default in php.ini after script execution.
The only small functional difference seems to be that ini_set
returns false
when it was unable to change the setting and error_reporting
always returns the old error level.