How does Yii work without "?>" ?

In the entry script, it starts with "<?php …" but it does not end with "?>." It seems that many places in the Yii web application work like that. How does it exactly work? Where Yii fills in the close braket "?>" and how?


Php doesn't require the ?> to be there. In fact it's a coding standard since it eliminates the possibility of having spaces after the ?>

This doesn't apply to mixed html/php files.


I thought php requires "<?php  … ?>" pair and moreover, I tested only with the html mixed with php not a script itself.

This is very confusing for newbies used to work with C, Java, XML…

Beside the ?> I even miss a closing bracket at the end of the

class ContactForm extends CFormModel                                         


in the file ContactForm.php of the testdrive demo webapp

but at the end it seems to work :unsure: