Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Bug debugging in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 121
    Comment on it

    We do many wrong things while writing the program.

    It rarely work on the first time.

    PHP generate the error after finding.

    We can send the error message to other place.

    They can also be sent with other program output also.

    Set the display_error directive on.

    To send error to the web server log set log_error also on.

    We can on both of them to display at both the places.

     

    PHP define constant we can use to set the value of error_reporting that only error of certain type get reported-

    E_ALL- for all errors except strict notices

    E_PARSE0- parse errors

    E_ERROR- fatal errors

    E_WARNING- warnings

    E_NOTICE- notices

    E_STRICT- strict notices

     

    We should have knowledge of editor like BBEdit.

     

    There are various which we need to keep in mind while writing the code-

    1. Missing semicolon- Every php statement should end with semicolon.

    2. Not enough equal sign- When we compare two values we need to have two equal to sign in.

    3. Misspelled variable name- It should be named properly but if it is not then it is considered as a new variable.

    4. Missing dollar sign- If a dollar sign is missing then it is hard to read this.

    5. Troubling qoute- We can many, few qoute.

    6. Missing parenthesis and bracket- They should always be their in pair.

    7. Array index- All the should be there with 0 not 1.

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: