![]() |
Do you end your PHP documents with "?>"?
Zend actually recommend that you don't place the ending PHP tag
?> because that way it prevents any white-spacing creeping in after you've ended the ?> tag.I think we've all experienced that problem before. Usually the first thing to detect a white-space is the session class, which is unable to work when output has been started because the session class wishes to send HTTP headers. Often is the case that your document is as follows, and you spend all your time trying to find the white-space: "?> "Quite a few IDEs now will actually trim the document before saving and thus eliminating that issue. With Zend's recommendations, however, I can only feel one way at the moment, and that my document seems incomplete without the closing PHP tag. |
I got into the habit of leaving it out, in fact it became part of the coding standards at work.
|
I also leave out the closing PHP tag at the end of files, to me it seems a redundant extra line to include it.
|
Never heard of this before, but I am still fairly new to PHP. To me, I don't think I could leave it out. I like everything to match up to its rightful partner, and leaving a ?> off the end of the file would be like walking with one leg.
|
I started leaving it out after I wrote my application in an old IDE and I had white space errors on all the files.
|
I never add the PHP ending tag at the end of files...can cause alot of trouble, learned that lesson :)
|
I never add it.
|
I learned to never add it as well. :)
|
I've just learnt my new thing for the day. Will have to get used to the feeling of walking with a leg missing :-)
Thanks ;-) |
I use it some times and some times i don't ;)
|
Consistent then Codefreek :-)
|
Yeah ;), one thing that came to mind you could just write a function, to check for whitespace ?, Can't you do that..
|
I like to have it there for personal reasons, just makes it easier to find the end of the document.
|
Sure you could write a function, or just miss the ending tag out.
|
Are we talking about like a functions file? I put it just to be safe...
|
Quote:
PHP Code:
Quote:
Though, I only use classfiles nowadays, 'cause I'm using my framework which applies the MVC-structure, so basicly, all files are classes. Except helpers and view-files. |
I never had problems with it so yeah, i still place it there... Don't know why though, i know it can give me problems
|
Quote:
|
Quote:
|
Quote:
|
| All times are GMT. The time now is 11:34 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0