Welcome Guest, Not a member yet? Register   Sign In
badly closed PHP config files


I just noticed that most (if not all) PHP files under 'system/application/config' dir are not closed.
There is a missing '?>' at the end.


?> ===> *missing*

I noticed that on 1.6.3 and fixed it myself a year ago (I thought I mistakenly removed them).
However, I upgraded to 1.7.1 yesterday, and in the merge I noticed that its missing in the source.

[eluser]Pascal Kriete[/eluser]
They aren't needed in files that are PHP only (no html or other output). Errors caused by whitespace were (and still are) a frequent support problem, so the closing tags were removed and replaced with an end-of-file code comment. It's noted in the style guide.

To add on to what Pascal said and also some personal experience, closing tags can really be bothersome sometimes. If you have just one space after the tag it can cause some really bad problems and if you are a non-experienced programmer, it can take you awhile to figure out what's wrong. I for one don't use them anymore heh.

Despite these potential problems of closing php tags, I for some reason hate not having them (not enough to add tem to core files, just to my own)
I've never had any problem yet

This is by design, read this: http://ellislab.com/codeigniter/user-gui...losing_tag

Theme © iAndrew 2016 - Forum software by © MyBB