मैं इस पृष्ठ से इस उदाहरण # 1 को चलाने की कोशिश कर रहा हूं: http://php.net/manual/en/language.exception.pp
<?php
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
return 1/$x;
}
try {
echo inverse(5) . "\n";
echo inverse(0) . "\n";
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
// Continue execution
echo "Hello World\n";
?>
हालांकि वांछित उत्पादन के बजाय मुझे मिलता है:
0.2
Fatal error: Uncaught exception 'Exception' with message 'Division by zero.'
in xxx:
7 Stack trace: #0 xxx(14): inverse(0) #1 {main} thrown in xxx on line 7
मैं जिस डेवलपर वातावरण का उपयोग कर रहा हूं, वह UniServer 3.5हैPHP 5.2.3