作者high38 (自high)
看板PHP
標題[請益] 程式有誤,請高手指點
時間Fri Mar 20 12:47:56 2009
實在很抱歉找不到問題點才在這邊求高手幫助
這是我們公司把外包程式放在自己主機上
應該版本也是 PHP5 可以合
不過就一行錯誤一直搞不懂
[Fri Mar 20 12:46:03 2009] [error] [client] PHP Parse error:
syntax error, unexpected T_THROW, expecting T_STRING in
/var/www/html/mytpc/_class/spot/Exception.php on line 9
Exception.php 程式碼如下
class Exception {
/**
* throw error message
* @param String $clz
* @param String $msg
*/
function throw($clz, $msg) { //<--這是第9行
$str = $clz;
if ( is_object($clz) ) {
$str = get_class($clz);
}
echo "[".$str."]"." ".$msg."\n";
}
/**
* throw error message and stop process
* @param String $clz
* @param String $msg
*/
function error($clz, $msg) {
Exception::throw($clz,$msg);
exit();
}
}
看錯誤碼感覺上是很普通的字串少東西的錯誤
不過怎麼看都看不出來問題
前面是有 require include 一大堆,不過這是在一開始就錯誤
把這邊程式改一改錯誤碼也是跟著這邊在動
想請問一下這邊有可能出現什麼樣的錯誤 ?
感謝 !
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.207.2.26
※ 編輯: high38 來自: 203.207.2.26 (03/20 12:48)
1F:推 fillano :php5加入了try/catch/throw做例外處理,你用了throw 03/20 13:47
2F:推 buganini :throw可能跟exception handling的syntax衝到了 03/20 13:48
3F:→ high38 :感謝樓上兩位大大 那請問我現在該怎麼辦? 03/20 13:55
4F:推 buganini :改名字或是直接拔掉囉 03/20 15:24
5F:→ high38 :感謝f跟b大 在把 throw 跟 exception 掃一次全改名 03/20 16:08
6F:→ high38 :目前問題暫時解決,剩一下小 notice 不過已經秀得出 03/20 16:08
7F:→ high38 :頁面,再次感謝 03/20 16:08