+ 2

What are E_ERROR,E_PARSE,E_WARNING,E_NOTICE?

What is use of those error constants?

15th Aug 2020, 9:45 AM
Akshay Harshora
Akshay Harshora - avatar
3 Answers
+ 1
E_CORE_ERROR: This is a fatal error when you start PHP. It is an error in a configuration or PHP isn't able to operate. E_CORE_WARNING: This can happen if something went wrong in your configuration that does not complete terminate your Execution System. E_STRICT: These are notifications which makes suggestions of how you can make your program code better. E_ALL: This is, a constant of all errors supported except E_STRICT.
15th Aug 2020, 10:16 AM
S-Coder
S-Coder - avatar
+ 1
Those messages are representing the different error levels: E_ERROR: If this is thrown while parsing the PHP-Code the PHP Script will shut down. E_WARNING: This is a critical error that does not terminate the execution of your script. But It is needed to be fixed 'cause of undefined behavior. E_PARSE: If this is thrown, you have syntactically errors in your code. This will terminate the execution. E_NOTICE: This is only a little error that notifies you. For example if you had declared a variable that is not assigned you will get a notice. I hope this would help you.
15th Aug 2020, 9:53 AM
S-Coder
S-Coder - avatar
+ 1
S-Coder thank you for such perfect explaination Can you explain me about E_CORE_ERROR, E_CORE_WARNING, E_ALL,E_STRICT? if you know
15th Aug 2020, 10:04 AM
Akshay Harshora
Akshay Harshora - avatar