嗯,我有一个WampServer安装在我的WinXP框与PHP 3.5.3和apache 2.2.17。奇怪的是,try catch块不起作用,在google搜索后我只能发现bug在eaccelerator中(但phpinfo没有显示它的踪迹)。尝试在PHP 5.3.5 Catch块不工作
我在哪里出错?
try{
echo "from try";
parent::conect();
}catch(Exception $e){
echo "from catch";}
我的输出应该
from tryfrom catch
而是我得到
from try
Fatal Error: cannot access parent:: when no class...
你可以发布你的代码吗? –
我假设你不希望尝试/捕捉从空气中工作。你的代码在哪里? – adlawson
无法重现,适合我。你需要给我们更多的细节。 – deceze