title: PHP Impoved error messaging on pages that fail parsing
body: <p>This isn't quite a &quot;fix my code&quot; question, more of a configuration. I'm working with the HTML/Javascript/PHP/MySql stack. I'm a seasoned C#/TSQL developer but fairly new to this stack. I'm finding debugging very frustrating as compliation/parse errors are not shown during development. For example, after making a series of modifications, in one of my PHP libraries I've had the following:</p>
  <pre><code>    function sp_AssignNotificationsToUsr($CreateGUID, $UsrID, &amp;$message) // boolean
      // This assigns any notifications with the CreateGUID passed, to the UsrID passed.
      // If successful, returns true, else false.
      // If false is returned, look in $message for an error message.
      {
          try
          {
              $sql = &quot;&quot;;
              $sql .= &quot;SET @CreateGUID = &quot; . Str2SQL($CreateGUID) . &quot;;&quot; . PHP_EOL;
              $sql .= &quot;SET @UsrID = &quot; . $UsrID . &quot;;&quot; . PHP_EOL;
              $sql .= &quot;&quot; . PHP_EOL;
              $sql .= &quot;CALL AssignNotificationsToUsr(@CreateGUID, @UsrID);&quot; . PHP_EOL;
              $sql .= &quot;&quot; . PHP_EOL;
  
              $db = new DB;
              if (!$db-&gt;connect()) throw new Exception(&quot;Could not connect to database correctly.&quot;);           
              $dss = $db-&gt;executeMultiQuery2($sql);
              $db-&gt;disconnect();
              return true;
          }
          catch (Exception $e)
          {
              $message = $-&gt;getMessage();
              ErrorMessageEmail(&quot;sprocs.php:sp_AssignNotificationsToUsr&quot;, 1, $e);
              return false;
          }
      }
  </code></pre>
  <p>When I run the calling page, it returns empty with no errors. I have already executed the following during the page:</p>
  <pre><code>    ini_set('display_startup_errors', 1);
      ini_set('display_errors', 'On');
      error_reporting(E_ALL);
  </code></pre>
  <p>When this occurs (no output, no errors), I then spend time commenting in and out great swathes of code in various files, trying to pin down where the parse error is. In this instance, it turned out to be that:</p>
  <p><code>$message = $-&gt;getMessage();</code></p>
  <p>should have been:</p>
  <p><code>$message = $e-&gt;getMessage();</code></p>
  <p>I'm used to Visual Studio pointing out parse errors before I even try to run code, which obviously isn't how it works here. I'm using Notepad++ as an editor. Is there some configuration I can use to show compile time errors like this? The same with the client-side Javascript. If it has a parse error it just does nothing with no errors shown. How can I get the errors from the parser shown?</p>