Final Errors in Php

Embed Size (px)

Citation preview

  • 8/18/2019 Final Errors in Php

    1/4

  • 8/18/2019 Final Errors in Php

    2/4

    2. Fatal Errors

    'atal errors are caused when # understands what you5ve written, however what you5re asking it to

    do can5t be done. 'atal errors stop the execution of the script. 4f you are trying to access the undefinedfunctions, then the output is a fatal error.

    Example

    /0php

    function fun6$&

    7

    echo "8ineet %aini"*

    9

    fun$&*

    echo "'atal Error ;;"*

    03

    Output

    4n the above code we defined a function fun6 but we call another function fun i.e. func is not

    defined. %o a fatal error will be produced that stops the execution of the script. 2ike as in the following

    image.

    3. Warning Errors

  • 8/18/2019 Final Errors in Php

    3/4

    Warning errors will not stop execution of the script. )he main reason for warning errors are to include a

    missing file or using the incorrect number of parameters in a function.

    Example

    /0php 

    echo "Warning Error;;"*

    inclue $"Welcome.php"&*

    03

    Output

    4n the above code we include a welcome.php file, however the welcome.php file does not exist in the

    directory. %o there will be a warning error produced but that does not stop the execution of the script

    i.e. you will see a message Warning Error ;;. 2ike in the following image:

    !. "otice Errors

    (otice that an error is the same as a warning error i.e. in the notice error execution of the script does

    not stop. (otice that the error occurs when you try to access the undefined variable, then produce a

    notice error.

    Example

    /0php

  • 8/18/2019 Final Errors in Php

    4/4