What are the arguments against the use of the "<?="?
Possible Duplicate:
Are PHP short tags acceptable to use?
The <?=
is one of the very few elegant things about PHP, IMO. Yet, there are people that deliberately avoid it (in favor of the much longer <?php echo
). Why would they do that?
<?=
is easier to use but some servers don't support short tags. Therefore, if you ever run into a server that doesn't support them, you need to replace all tags.
A more elaborate answer is already given: Are PHP short tags acceptable to use?
由于该功能在PHP中未默认启用,因此如果其他人使用不支持的代码,则代码会中断。
The problem is that not all servers support short tags
If you are developing an application for an controlled environment (for example, it will run only on your company server), then I don't see any problems with short tags
But, if it'll be a redistributable code, them you should open all tags explicitly <?php echo ?>
上一篇: PHP EMPTY令牌
下一篇: 什么是反对使用“<?=”的论据?