try{}catch($e){
  
}
这个里面的$e 是什么意思?相关的属性和方法是在哪里定义的怎么查看?

解决方案 »

  1.   

    比如:
    <?php
    class TDbException extends exception{}class test {
        public function __construct()
        {
            throw new exception('some error messages.');
        }
        public function method1()
        {
            throw new TDbException('db error');
        }
    }try {
        $a = new test;
        $a->method1();
    } catch (exception $e) { 
        var_dump($e);
    } catch (TDbException $dbe){
        var_dump($dbe);
    }
    ?>$e 相当于exception类或其子类的一个实例。