我的意思是如果它被调用$request
这不是 的实例sfWebRequest
,这会是致命的,还是只是一个警告?
class jobActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
$this->jobeet_job_list = Doctrine::getTable('JobeetJob')
->createQuery('a')
->execute();
}
// ...
}
请参阅有关章节PHP 手册中的类型提示 http://php.net/manual/en/language.oop5.typehinting.php
If $request
不是一个sfWebRequest
实例or其子类or实施界面 http://www.php.net/manual/en/language.oop5.interfaces.php对于这个名字,该方法将引发可捕获的致命错误 https://www.php.net/manual/en/book.errorfunc.php。如果不处理错误,脚本执行将终止。
Example
class A {}
class B extends A {}
class C {}
function foo(A $obj) {}
foo(new A);
foo(new B);
foo(new C); // will raise an error and terminate script
带接口
interface A {}
class B implements A {}
class C {}
function foo(A $obj) {}
foo(new B);
foo(new C); // will raise an error and terminate script
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)