deprecated Is the lowest level of error , Express “ Not recommended , Don't suggest ”. such as PHP5 Used in ereg Regular functions will report a series of such errors . This error is generally due to the use of deprecated 、 Caused by outdated functions or syntax . Although it does not affect PHP Normal process , But in general, it is suggested to amend .
The second is notice. This kind of mistake is usually an improper place in grammar . If a variable is used but not defined, this error will be reported . The most common is not to use quotation marks when the array index is a character ,PHP As a constant , First look up the constant table , Can't find any more variables that are treated as . although PHP It's script language , Grammar requirements are not strict , However, it is still recommended to initialize variables . This error does not affect PHP Normal process .
warning It's a high-level error , This error will only be reported when there is a very inappropriate situation in the grammar , For example, the function parameters do not match . This level of error can lead to unexpected results , You need to change the code .
A higher level of error is fetal error. It's a fatal mistake , Directly lead to PHP Process termination , The following code is no longer executed . This problem must be solved
High level errors are syntax parsing errors prase error. All the mistakes mentioned above belong to PHP Error during code run , The syntax parsing error belongs to the syntax checking phase error , This will lead to PHP Code failed syntax check .
Here are just a few of the most common ,php There are two manuals in total 16 A level of error .
$date = date('Y-m-d');;
if(ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})",$date,$regs)){
echo $regs[1]."-".$regs[2]."-".$regs[3];
}else{
echo " There is no match for ";
}
//Deprecated( stay php5 edition ),Fatal error( stay php7 edition )
if($i > 2020){
echo '$i Not initialized !!!',PHP_EOL;
}
//Notice
$arr = array('arr'=>1,2,3);
echo $arr[arr];
//Warning
$res = array_sum($arr,1);
//Warning
echo fun();
//Fatal error
echo " The highest level error ';
//Parse errorThe above code demonstrates php Several common error levels , If the output is not complete , You can see php.ini The configuration file to see if the following settings
error_reporting=E_ALL | E_STRICT
display_errors=OnAmong them error_reporting Is to specify the error level ,display_errors Not to mention .








![[opencv learning] perspective transformation matrix](/img/6e/7a53b257f6baafe8a3ae21cd0fe340.jpg)