Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Having said which, I'm confused by the lack of a closing ?>. Maybe PHP's parser lets you get away with that though.

It's completely optional.



...and best practice is to omit it. Since PHP is a templating language any whitespace (other than a single newline) that comes after the ?> will be printed directly to stdout when the file is parsed, which is almost never what the author intends. Letting the parser insert it for you avoids this class of bugs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: