Your call to error_reporting()
doesn't do anything because it does not run.
There is a missing ;
after the first echo
. I know you know about it, you made the mistake on purpose, to show that error_reporting()
doesn't do what you expect it to do.
It doesn't work this way. The missing semicolumn is a syntax error. The script does not compile, so it does not run. Your call to error_reporting()
is not executed and that means the value of the error_reporting
configuration directive is the one that decides what errors are reported.
You have to fix the syntax errors first, make the script compile & run, and only after that try to trigger a runtime error and see if it is reported back to you. I bet it is.
A runtime error or warning is easy to generate. Try a division by zero, for example.