i have a page simply like this:
error_reporting(-1);
require('test.txt');
i know that test.txt not exists .i want to try error_reporting() function.
in this case that we pass number -1 to function all error reported correctly like this:
Warning: require(test.txt) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\PHP_Class\session_5\errors.php on line 11
Fatal error: require() [function.require]: Failed opening required 'test.txt' (include_path='.;C:\php\pear') in C:\wamp\www\PHP_Class\session_5\errors.php on line 11
and when we pass number 2 to function like error_reporting(2) only E_WARNING error reported and this is correct too:
Warning: require(test.txt) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\PHP_Class\session_5\errors.php on line 11
but when i pass number 1 to function like error_reporting(1) for report E_ERROR errors only , no error display.
what is problem? please tell me
I think require doesn’t throw an
E_ERRORbut anE_COMPILE_ERROR.So please try it with
error_reporting(E_COMPILE_ERROR);