PHP Interview questions

Total available count: 33
Subject - PHP Frameworks
Subsubject - PHP

What are the different types of errors in PHP?

There are four types of errors in PHP, which are as follows:

1. Parse Error: The parse error occurs if there is a syntax mistake in the script; A parse error stops the execution of the script


echo "Slightbook;
echo "Slightbook"
echo Slightbook";

Some of the reasons given below which are causing Parse errors.

Missing parentheses, Extra parentheses, Missing semicolon, Unclosed quotes, Unclosed braces.

2. Fatal Error: Fatal errors are caused when PHP understands what you have written, however what you"re asking it to do can't be done. Fatal errors stop the execution of the script. If you are trying to access the undefined functions, then the output is a fatal error


function sb1()
echo "Slightbook";
echo "Fatal Error";


3. Warning Error: Warning errors will not stop execution of the script. The main reason for warning errors are to include a missing file or using the incorrect number of parameters in a function


echo "Warning Error!!";
include ("default.php");

4. Notice Errors: Notice that an error is the same as a warning error i.e. in the notice error execution of the script does not stop. Notice that the error occurs when you try to access the undefined variable, then produce a notice error


echo "Notice Error";
echo $sb2;


Next 2 interview question(s)

Explain about include(), require(), include_once() and require_once() ?
What is PHP?