本帖最后由 yangyibang 于 2010-11-08 21:37:34 编辑

解决方案 »

  1.   

    该参数必须为Application_Model_Guestbook类对象
    手册上看:
    http://php.net/manual/en/language.oop5.typehinting.php
      

  2.   

    这是 php5.1 引入的排错机制
    当函数(方法)定义时声明了参数的类类型时
    在调用时必须传递该类或派生类的对象如
    class A {}
    class B extends A {}
    class C {}function foo(A $p) {}$p = new B;
    foo($p); //正确$p = new C;
    foo($p); //出错