PHP异常学习练习
<?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 [...]
posted on 2012-03-13 11:39 wenjuncool 阅读(135) 评论(0) 编辑 收藏 举报