What is the advantage of not having the closing tag `?>` In the PHP class file?

Possible duplicate:
PHP closing tag

I saw a lot of PHP class files that don't have a closure ?>, but instead:

<?php
class DataTypeLine extends DataType {
    ...
}
?>

they just have this:

<?php
class DataTypeLine extends DataType {
    ...
}

I also notice that when I create a new PHP file in Eclipse Helios , by default it has only the start tag <?php, but without the end of the tag ?> .

What is the advantage of missing a tag ?>?

+5
source share
3 answers

- , , , ..

, , :

<?php
    /* do stuff */
?>

<!-- note the empty space above, this comment not really part of the code -->

,

<?php
    require 'myfile.php';
    header('Location: http://example.com/');
?>

, - . ?>, .

+8

PHP

PHP , , , include() require(), , . , , .

+5

. PHP \n . , . Windows , \r\n ?>, , Unix-.

, (, ).

+1

All Articles