[Wylug-help] vim line in PHP/HTML file

Smylers Smylers at stripey.com
Tue Apr 16 15:18:16 UTC 2013


Martyn Ranyard writes:

> short codes are BAD!

Hi Martyn. Out of interest -- why?

> the correct way to tell a php interpreter that you want code to be
> interpreted is "<?php".  Perhaps vim is discouraging this old bad
> practice, try the following :
> 
> <?php // vim: ft=php nowrap ai et ic

Nope, Vim doesn't try to interpret the PHP in any way.

Vim only cares about "vim:" at the top (or bottom) of a file and what
follows it; anything before that gets ignored by Vim.

> Also, worth noting that current best practice is to omit the final
> "?>" at the end of the file, as that leads to random blank lines,
> which end up in your output and causes output to happen often before
> headers are sent by webservers.

Makes sense. Thanks.

Smylers
-- 
Stop drug companies hiding negative research results.
Sign the AllTrials petition to get all clinical research results published.
Read more: http://www.alltrials.net/blog/the-alltrials-campaign/



More information about the Wylug-help mailing list