I thought PHP required semi colons?
<p>I recently upgraded my servers (local WAMP and production boxes to PHP 5.4) and am cornfused with the usage of semi-colons, I'm not complaining I have no love for the ; but don't get how this code runs locally and on a production box with no errors and error reporting is set to E_ALL...</p>

<p>I thought I needed a ; after <code>&lt;? phpinfo ?&gt;</code>&lt;-- apparently not!</p>

<p>This does not generate an error either: <code>&lt;? print_r(apache_get_modules()) ?&gt;</code></p>

<p>This works without semi-colons as well: <code>&lt;? foreach (getallheaders() as $name =&gt; $value) printf("%s:%s \n", $name, $value, PHP_EOL) ?&gt;</code></p>

<p>All of this code doesn't gen an error and while like the omission of my friend the ; I am wondering WTF is happening?</p>

<p>Is is because of my PHP 5.4 version or do phpinfo, print_r and printf not require semi colons?????</p>

<p>All of this code runs with no errors:</p>

<pre><code>&lt;div id="tabs"&gt;
    &lt;div id="tab_one"&gt;&lt;pre&gt;Server Variables: &lt;? print_r($_SERVER) ?&gt;&lt;/pre&gt;&lt;/div&gt;
    &lt;div id="tab_two"&gt;&lt;pre&gt;Server and PHP interface: &lt;?= PHP_SAPI ?&gt;&lt;/pre&gt;&lt;/div&gt;
    &lt;div id="tab_three"&gt;&lt;pre&gt;Apache Modules: &lt;? print_r(apache_get_modules()) ?&gt;&lt;/pre&gt;&lt;/div&gt;
    &lt;div id="tab_four"&gt;&lt;pre&gt;&lt;?= apache_get_version() ?&gt;&lt;/pre&gt;&lt;/div&gt;
    &lt;div id="tab_five"&gt;&lt;pre&gt;&lt;? foreach (getallheaders() as $name =&gt; $value) printf("%s:%s \n", $name, $value, PHP_EOL) ?&gt;&lt;/pre&gt;&lt;/div&gt;
    &lt;div id="tab_six"&gt;
        &lt;p&gt;&lt;a href="/server-status?refresh=3" target="_blank"&gt;Server Status&lt;/a&gt;&lt;/p&gt;
        &lt;br /&gt;
        &lt;p&gt;&lt;a href="/server-info/" target="_blank"&gt;Server Info&lt;/a&gt;&lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Cornfused?</p>
