<?php class MyException extends Exception { } class Test { public function testing($x) { try { echo 1/$x; } catch (MyException $e) { echo $e->getMessage('Деление на ноль.'); } } } $foo = new Test; $foo->testing(0); ?>
class MyException extends Exception { } class Test { public function testing($x) { try { echo 1/$x; } catch (MyException $e) { echo $e->getMessage('Деление на ноль.'); } } } $foo = new Test; $foo->testing(0);