title: php heredoc -- not echoing '<script type="text/javascript">'
body: <p>I've used heredoc syntax in server-side php to clean up the code -- my understanding of the utility of heredoc is "allows you to send client-side code to the browser and avoid individual echo's for each browser-side code statement"</p>
  
  <p>My understanding of heredoc is that it just makes it easier to encapsulate a chunk of code you need to send to the browser without having to write an explicit 'echo' on every line, basically "Ok web server -- between the '&lt;&lt;&lt;' and the end of the heredoc, all this should be sent to the browser."</p>
  
  <p>So I'm not sure why I'm getting syntax errors for the following code:</p>
  
  <pre><code> &lt;?php
   echo &lt;&lt;&lt;_SENDITALL 
   &lt;script type="text/javascript"&gt;
   function foo(theArg1, theArg2, theArg3)
   {
   }
   &lt;/script&gt;
   _SENDITALL;
   ?&gt;
  </code></pre>
  
  <p>I've got heredocs all over the place in my project and they work fine so I'm not understanding why my Netbeans IDE keeps flagging the above with syntax errors.</p>
  
  <p>For example, I use heredoc to send forms to the browser.  And I've got javascript doing input validation on my html forms, with 'onsubmit' and 'onblur' etc. </p>
  
  <p>So surely it can't be that php is of the mind "See here, it's fine if you heredoc html script to the browser, but your attempt to heredoc some client-side javascript will not stand' -- that wouldn't make sense both html and javascript are client-side, why would the heredoc syntax "care" whether html script or javascript was being sent to the browser.</p>