try'n'catch
| From: | Andrey Korolyov | Date: | Tue, 08 Jun 2004 20:56:21 +0000 |
| Subject: | try'n'catch | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-187930@lists.php.net to get a copy of this message | ||
<?php
class MyException {
function __construct($exception) {
$this->exception = $exception;} function Display() {
print "MyException: $this->exception\n";} } class MyExceptionFoo extends MyException { function __construct($exception) {
$this->exception = $exception;} function Display() {
print "MyException: $this->exception\n";} } try { throw new MyExceptionFoo('Hello'); } catch (MyException $exception) { $exception->Display(); } catch (Exception $exception) { echo $exception; } ?> Not work :((( Example from http://www.php.net/zend-engine-2.php Anybody can explain for me how it's work in php5 ?