How is this valid php code?
<p>I'm modifying a wordpress template and I'm curious as to how this is a valid control structure in PHP.  Anyone have any insight?</p>

<pre><code>&lt;?php if(condition): ?&gt;
&lt;?php if(!condition || !function()) ?&gt;
&lt;?php elseif(condition): ?&gt;
&lt;?php if(!condition || !function()) ?&gt;
&lt;?php endif; ?&gt;
</code></pre>

<p>If I remove all the tags, I get (with more sane indentation):</p>

<pre><code>&lt;?php
if(condition):
    if(!condition || !function())
elseif(condition):
    if(!condition || !function())
endif;
?&gt;
</code></pre>

<p>which is invalid because the indented <code>if</code> statements don't end.  So how/why is this code valid if there are opening and closing php tags everywhere?</p>

<hr>

<p>Edit for Kerrek SB.  Make a php file and run it.  It's valid:</p>

<pre><code>&lt;?php if(true): ?&gt;
&lt;?php if(true) ?&gt;
&lt;?php endif; ?&gt;
&lt;?php echo 'here'; ?&gt;
</code></pre>
