What is an
Error in PHP?
An error is a type of mistake, in another words we can say
that error is a condition of having incorrect false knowledge or it is
defined as an unexpected.
and Mistake
is an error caused by a fault.
Types of error
- Parse
Error or Syntax Error
- Fatal
Error
- Warning
Error
- Notice Error
- Parse Errors (syntax errors) : It will occur when there is a syntax mistake in the script.
Following are the reason of syntax errors:
- Unclosed
quotes
- Missing
or Extra parentheses
- Unclosed
braces
- Missing
semicolon
Example
<?php
echo "Correct syntax";
echo "synatx Error"
echo "Synatx Error":
?>
It will occur when PHP couldn’t understand what
you've written. It stop the execution of the script.
Example
<?php
function
fun1(){
echo
"Hello PHP";
}
fun2();
echo
"Fatal Error !!";
?>
3. Warning
Errors
It will
occur when the file is missing or incorrect number of parameter . It doesn’t
stop the execution of script.
<?php echo "Warning Error!!";
include ("index.php");
?>
include ("index.php");
?>
4. Notice Errors
It will occur when you have
not declare variable. It is same as warning error i.e.
<?php
$a="Hello PHP";
echo "Notice Error !!";
echo $b;
?>
$a="Hello PHP";
echo "Notice Error !!";
echo $b;
?>
0 $type={blogger}:
Post a Comment