Detecting text outside php open tags
<p>Is it possible to detect text outside php open and close tags. Most of the time there is text outside these tags as a result of typo. Since it is "syntactically" correct to have text outside these tags, php -l exits with a success</p>

<pre><code>some random unwanted text due to a typo
&lt;?
 //some useful code
?&gt;
</code></pre>

<p>I want to detect that there is some text before php open tags</p>
