您的位置:首页 > 编程语言 > PHP开发

PHP异常学习练习

2012-03-13 11:39 288 查看
<?php class Exception_1 extends Exception { private $error; public function __construct($error) { return $this->error=$error; } } class Exception_2 extends Exception { private $error; public function __construct($error) { return $this->error=$error; } } class Test_throw { public function __construct() { // throw new Exception_1(“error-1″); throw new Exception_2(“error-2″); // throw new Exception(“error-0″); } } try{ $test=new Test_throw; }catch(Exception_1 [...]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: