mirror of
https://github.com/php/presentations.git
synced 2026-03-24 15:42:33 +01:00
29 lines
497 B
PHP
29 lines
497 B
PHP
<?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();
|
|
}
|
|
?>
|