How come in some PHP files the closing ?> tag is intentionally ommitted?

E-Moses

New member
I already know that the script will run without the closing tag (so long as it isn't embedded in HTML or something)

But my instructors actual question that I've been asked to find the answer to is 'why some developers actually exclude the closing PHP tags in some files, and also, why is it that some of these scripts won't run correctly if you add the closing tags?' And he is not referring to instances where these are require or includes, where the closing tags can be found in some refactored PHP file. He is talking about single one page independent PHP scripts that will not run correctly if closed "?>"

I especially appreciate your answer if you can point me in a direction where this is documented, or explained in a forum:)

My instructor is giving extra credit to which ever student can provide a reasonable explanation. And you of course will get like 1,000,000 Y!A points[yeah]
 
Back
Top