Re: POLL: To add the final ?> or not...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey

Haven't had the time to read up on the maillist, but here's my input.

Mattias Thorslund wrote on 09/01/2010 02:26:

To my eyes, ?> means "look there is more content coming", which seems kind of silly when there isn't.

To mine it means, no more PHP code for now. I don't wanna make it diffenrent from a file containing pure PHP code or one that contains both PHP and HTML, where I jump in and out of the PHP tag.

Remember the ?> stops the parser

And I find it bad coding standard to start a tag and not end it, even if it's possible. Remember Perl is a smart, but also terrible language, where one can leave out the ; in the end of a oneline script and make a bunch of stuff on $_ without showing what variable you're working on.

And finally, mysql_close() was always called after a script was closed, so I've never learned to practice that and for the last ten years I've seen only _one_ developer added that function call to the end of his files. In PHP6 that call is required, so making the cleanest code is in my opinion more readable and also more correct, since you'll never know what the PHP core team will come up with next ;-)

A neat thing with pairing every <?php with a ?> when mixed in HTML is that these are valid XML processing instructions. If your HTML satisfies XML well-formedness, your PHP document will also be valid XML. Not that I've ever had any need to process my layout templates as XML but anyway.

I don't see your argument. PHP generates HTML or XML files. When you're aware of the XML tag of course you make sure the XML file generated is valid. Why would you ever add PHP code to a HTML file (other than for documentation, examples etc.)?

--
Kind regards
Kim Emax - masterminds.dk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux