title: How to remove PHP Notice from production environment not present in development environment
body: <p>I've built a web app that works perfectly in my development environment. In my production environment, however, I get notices that I cannot reproduce in my dev environment although I've set PHP to report all errors with 'error_reporting(E_ALL);' at the start of the page.
  eg,'Notice: Undefined index: name in /home/bontshit/public_html/admin/library/functions.php on line 202'. How can I track down the problem without simply muting the error reporting?</p>
  
  <p>I'm using The AppServ Open Project - 8.6.0 for Windows
  Now you running on PHP 5.6.30; my production environment is on the same version of PHP. I've added the code the notice I mentioned refers to and clearly (I believe) the index 'name' was defined.</p>
  
  <pre><code>$categories = array();
  while($row = dbFetchAssoc($result)) {
      extract($row);
  
      if ($cat_parent_id == 0) {
          // we create a new array for each top level categories
          $categories[$cat_id] = array('name' =&gt; $cat_name, 'children' =&gt; array());
      } else {
          // the child categories are put into the parent category's array
          $categories[$cat_parent_id]['children'][] = array('id' =&gt; $cat_id, 'name' =&gt; $cat_name);    
      }
  }   
  
  // build combo box options
  $list = '';
  foreach ($categories as $key =&gt; $value) {
      $name     = $value['name'];
      $children = $value['children'];
  
      $list .= "&lt;option value=\"$key\"";
  
      if ($key == $catId) {
          $list.= " selected";
      }
  
      $list .= "&gt;$name&lt;/option&gt;\r\n";
  
      foreach ($children as $child) {
          $list .= "&lt;option value=\"".$child['id']."\"";
          if ($child['id'] == $catId) {
              $list.= " selected";
          }
  
          $list .= "&gt;&amp;nbsp;&amp;nbsp;".$child['name']."&lt;/option&gt;\r\n";
      }
  }
  </code></pre>