作者aquarianboy (我是没牌的营养师!)
看板PHP
标题Re: [闲聊] 纯PHP开头跟结尾的档案没有加?> 以及 < …
时间Wed Sep 10 14:27:34 2008
※ 引述《qazsd (Be brave & outstanding)》之铭言:
: test.php
: <?php
: echo 'hello';
: ----档案完毕(最後面没有加?>)
: 一样是可以执行,但是不清楚会不会有什麽影响或是潜在的bug
节录自ZF的手册的一段话(code standard)
http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html
For files that
contain only PHP code, the closing tag ("?>") is never
permitted. It is not required by PHP, and omitting it prevents the accidental
injection of trailing whitespace into the response.
: 另外 <?= 这个用法有PHP或是其他东西版本的限制吗
: 就是说安装的是某几版以上的PHP 才能执行
: 就像PHP 5以上就都得写<?php 而不能写 <? 一样
这个请自行参阅php.ini里的说明 :)
--
诚徵
PHP网站工程师,熟
MVC架构佳
http://blog.eddie.com.tw/
全职、兼职可,意者请敲 :)
http://www.eddie.com.tw/
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.132.128.37
※ 编辑: aquarianboy 来自: 220.132.128.37 (09/10 14:28)
1F:→ aquarianboy :php.ini里的short_open_tag段落 09/10 14:29
2F:推 qazsd :他说的files该不会是只用zend framework开发的吧?? 09/10 15:47