'Does PHP in html mode auto-trim only 1 new line after php tags?

PHP enters html-mode if there are no php tags. That's simple enough. This code:

<pre>a
<?php echo 'b';?>
c
</pre>

Will output:

a
bc

The new line after <?php echo 'b';?> is trimmed.
But this code (space after closing php tag):

<pre>a
<?php echo 'b';?> 
c
</pre>

Will output:

a
b           // there is a space after 'b '
c

So, is the new line after last php tag always trimmed? Are there any other hidden trimming, formatting or some automatic stuff going on?


Edit: Today I have learned new definition of php tags:

PHP ending tag is ?> with an optional newline.

Feel free to broaden the answer if php tags have any other hidden/magic/auto properties.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source