JiPER Posted December 28, 2007 Report Share Posted December 28, 2007 Hi, I've got a problem with exceptions in PHP5. When I throw exception, it doesn't propagate through the stack and fails with unhandled exception error, when tryin to catch it somewhere else in the code. Here's example of code, which doesn't work on my Uniform Server, but it works on standard webhosting. <?php function go($number) { if ($number == 0) { throw new Exception('Zero'); } } try { go(0); } catch (Exception $e) { echo $e->getMessage(); } ?> I've got the latest version of the Uniform Server - 3.5 Apollo. Please can anyone help? Thanks. Quote Link to comment Share on other sites More sharing options...
Ric Posted December 28, 2007 Report Share Posted December 28, 2007 The following maybe of interest: From apanel select eAccelerator (left menu)Now navigate to Actions (main screen) you will see five buttons.Starting from the top click each button in turn. (Disables Caching and Optimizer) Run your page with the problem code. Well! I ran your test code above and found it works fine, I have no idea what the cause is but suspect that eAccelerator caching could be the culprit! All the bestRic Quote Link to comment Share on other sites More sharing options...
JiPER Posted December 28, 2007 Author Report Share Posted December 28, 2007 Great, it's working now. I was very unhappy about it. Hope it won't repeat, but at least I know how to fix it now. Thank you very much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.