Hello, I am trying out a very simple code snippet - Example #1 from this page: http://php.net/manual/en/language.exceptions.php this code is as follows: <?php
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
else 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';
?> When opening the test file in my browser instead of the desired output I get: 0.2
Fatal error: Uncaught exception 'Exception' with message 'Division by zero.' in W:\www\test.php:4 Stack trace: #0 W:\www\test.php(11): inverse(0) #1 {main} thrown in W:\www\test.php on line 4 However if I run the code from the console, everything works fine... do you have any ideas what went wrong there? php -f w:\www\test.php PS. Some additional information - I have UniServer 3.5 and today I tried out the 5.5 version, however there were some problems with it (exception when starting the service), so I deleted the new one and continued using UniServer 3.5. Also at some point I had the intention of integrating PHP with IIS, so I installed PHP on my computer, but I deinstalled it in the meantime...