Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3978634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:04:21+00:00 2026-05-20T05:04:21+00:00

As a developer, I work with E_NOTICE turned on. Recently though, I was asked

  • 0

As a developer, I work with E_NOTICE turned on. Recently though, I was asked why E_NOTICE errors should be fixed. The only reason that I could come up with was that it is best practice to correct those problems.

Does anyone else have any reasons to justify the extra time/cost spent to correct these problems?

More specifically, why should a manager spend the money to have these fixed if the code already works?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:04:21+00:00Added an answer on May 20, 2026 at 5:04 am

    SUMMARY

    The PHP Runtime Configuration Docs give you some idea why:

    Enabling E_NOTICE during development has some benefits.

    For debugging purposes: NOTICE messages will warn you about possible bugs in your code. For example, use of unassigned values is warned. It is extremely useful to find typos and to save time for debugging.

    NOTICE messages will warn you about bad style. For example, $arr[item] is better to be written as $arr[‘item’] since PHP tries to treat "item" as constant. If it is not a constant, PHP assumes it is a string index for the array.

    Here’s a more detailed explanation of each…


    1. TO DETECT TYPOS

    The main cause of E_NOTICE errors is typos.

    Example – notice.php

    <?php
    $username = 'joe';        // in real life this would be from $_SESSION
    
    // and then much further down in the code...
    
    if ($usernmae) {            // typo, $usernmae expands to null
        echo "Logged in";
    }
    else {
        echo "Please log in...";
    }
    ?>
    

    Output without E_NOTICE

    Please log in...
    

    Wrong! You didn’t mean that!

    Output with E_NOTICE

    Notice: Undefined variable: usernmae in /home/user/notice.php on line 3
    Please log in...
    

    In PHP, a variable that doesn’t exist will return null rather than causing an error, and that could cause code to behave differently than expected, so it’s best to heed E_NOTICE warnings.


    2. TO DETECT AMBIGUOUS ARRAY INDEXES

    It also warns you about array indexes that might change on you, e.g.

    Example – code looks like this today

    <?php
    
    $arr = array();
    $arr['username'] = 'fred';
    
    // then further down
    
    echo $arr[username];
    ?>
    

    Output without E_NOTICE

    fred
    

    Example – tomorrow you include a library

    <?php
    // tomorrow someone adds this
    include_once('somelib.php');
    
    $arr = array();
    $arr['username'] = 'fred';
    
    // then further down
    
    echo $arr[username];
    ?>
    

    and the library does something like this:

    <?php
    define("username", "Mary");
    ?>
    

    New output

    Empty, because now it expands to:

    echo $arr["Mary"];
    

    and there is no key Mary in $arr.

    Output with E_NOTICE

    If only the programmer had E_NOTICE on, PHP would have printed an error message:

    Notice: Use of undefined constant username - assumed 'username' in /home/user/example2.php on line 8
    fred
    

    3. THE BEST REASON

    If you don’t fix all the E_NOTICE errors that you think aren’t errors, you will probably grow complacent, and start ignoring the messages, and then one day when a real error happens, you won’t notice it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I work on a small web team where I am the only .NET developer
I recently had to work on a project where the previous developer modified the
I've done this a million times ... setting up a developer work station. Is
Duplicate What are your hard rules about commenting? A Developer I work with had
During our work as web developer for a meteorological company, we are faced with
I cannot get the internet explorer web developer tool bar to work with a
As a web developer, a number of the projects I work on fall under
As a web developer, a number of the projects I work on fall under
I am having a real problem at work with a highly ingrained developer obsessed
Based on their work, how do you distinguish a great SQL developer? Examples might

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.