作者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