Last modified: 2014-10-19 10:09:05 UTC
It would be best if all PHP files matched their opening tag with a proper closing tag at the end: <?php //bla ?> including even the generated LocalSettings.php. While not required, it would demonstrate well-formedness.
They were removed to avoid accidental whitespace issues, they will not be added back - they offer no additional functionality.
http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=33276 http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=23531 http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=23533
Well OK, but you never know. Look what bash is doing these days, suddenly printing lots of warnings: line 261: warning: here-document at line 253 delimited by end-of-file (wanted `EOF') OK, easy enough to fix when the time comes... ...if one has permissions to update all components.
Official Zend coding style is to omit the closing tags, for the same reason we do. It's unlikely they would change the parser so as to break their own code.
(In reply to comment #3) > Well OK, but you never know. Look what bash is doing these days, suddenly > printing lots of warnings: > line 261: warning: here-document at line 253 delimited by end-of-file (wanted > `EOF') What file is that in? Here-documents shouldn't be terminated by end-of-file. If we removed the ?> tags, this error would still occur, just the "?>" would be included in the string . . .
(In reply to comment #5) > (In reply to comment #3) > > Well OK, but you never know. Look what bash is doing these days, suddenly > > printing lots of warnings: > > line 261: warning: here-document at line 253 delimited by end-of-file (wanted > > `EOF') > > What file is that in? Here-documents shouldn't be terminated by end-of-file. > If we removed the ?> tags, this error would still occur, just the "?>" would be > included in the string . . . > He's complaining about bash, not PHP, and about some unrelated script, not about MediaWiki.
Oh, right.
No, I was saying: forget your closing ?>'s in php, and end up like the folks who forgot their closing EOFs in bash (will very soon): one day the webhost updates bash and all your programs start printing warnings before you can return from Hawaii to figure out what your readers are complaining about. I forgot that PHP also has here documents in addition to ?>, sorry for the confusion. Of course I don't even know how to spell PHP, so don't quote me.
(In reply to comment #8) > No, I was saying: forget your closing ?>'s in php, and end up like the > folks who forgot their closing EOFs in bash (will very soon): one day > the webhost updates bash and all your programs start printing warnings > before you can return from Hawaii to figure out what your readers are > complaining about. > First of all, PHP warnings aren't ever shown to visitors if your wiki is configured right, they'll just clutter the error log. And to explain why this will probably never cause warnings, I'll reply with a quote: (In reply to comment #4) > Official Zend coding style is to omit the closing tags, for the same reason we > do. It's unlikely they would change the parser so as to break their own code. >