note 94908 rejected from function.set-error-handler by thiago

From: Date: Wed, 02 Dec 2009 14:30:25 +0000
Subject: note 94908 rejected from function.set-error-handler by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163487@lists.php.net to get a copy of this message
Note Submitter: gawande dot vrushali at yahoo dot com ---- I have the following code: <?php function calc() { try { $a=1; $b=2; $result=$a*$b$c; if (!$result) { throw new Exception('Wrong Formula'); }else return $result; } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage() ; } } $calling=calc(); echo "<br>CALL : ".$calling; ?> Here I have written $result=$a*$b$c; which send a parser error, I want to know how to handle this error programatically, so that I can send proper message to user. I have also tried exception handling but its not working

« previous php.notes (#163487) next »