title: How to read and fix console messages for *uninitialized* variables
body: <p>I am developing an application that reads a csv file and generates a report. It is working properly. However, when I run my application in Eclipse IDE, I see messages on the console that I am not sure if it is a problem or not. </p>
  
  <p>I tried to use <code>isset</code> to fix the <code>uninitialized</code> variables and functions, but it did not solved my problem.  My question is: Should I worried about these messages? If, yes, how could I solve it? If I tried to run my application on a Unix server, I will a problem? I am having a hard time to interpret those messages. </p>
  
  <pre><code>[Wed May  1 09:03:30 2019] PHP Stack trace:
  [Wed May  1 09:03:30 2019] PHP   1. {main}() C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ReportApplication4.3\index.php:0
  [Wed May  1 09:03:30 2019] PHP   2. require_once() C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ReportApplication4.3\index.php:14
  [Wed May  1 09:03:30 2019] PHP   3. create_xlsx() C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ReportApplication4.3\controller\upload.php:38
  [Wed May  1 09:03:30 2019] PHP   4. require_once() C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ReportApplication4.3\controller\upload.php:60
  [Wed May  1 09:03:30 2019] PHP   5. createStatisticsReport($file = *uninitialized*) C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ExcelReportApplication4.3\model\xlsxGenerator.php:26
  [Wed May  1 09:03:30 2019] PHP   6. usort(*uninitialized*, *uninitialized*) C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ReportApplication4.3\model\xlsxGenerator.php:187
  [Wed May  1 09:03:30 2019] PHP   7. cmp($a = *uninitialized*, $b = *uninitialized*) C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ReportApplication4.3\model\xlsxGenerator.php:187
  [Wed May  1 09:03:30 2019] PHP Notice:  Undefined index: First Name in C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ReportApplication4.3\model\readStatisticsFile.php on line 102
  [Wed May  1 09:03:30 2019] PHP Stack trace:
  </code></pre>
  
  <p>In 5. I am checking is the variable is empty, but it still giving the error.</p>
  
  <p>Error:</p>
  
  <pre><code>[Wed May  1 09:03:30 2019] PHP   5. createStatisticsReport($file = *uninitialized*) C:\Users\jj-localadmin\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp6\htdocs\ExcelReportApplication4.3\model\xlsxGenerator.php:26
  
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>$fileName = 'data/uploadFile.csv'; // path for the csv file (registration and user statistics file are upload with the name)
  if ($answer == "Statistics") {
      require_once 'readStatisticsFile.php';
      if (validateStatsFile($fileName) == 'true' &amp;&amp; !empty($fileName))
                  createStatisticsReport($fileName);```
  
  
  </code></pre>