不需要, 但ZF里全是是这样的, 下面是他的一个函数, 如果我把前面的array去掉后正常, 那是多么大的工程啊, public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) { $this->setRequest($request) ->setResponse($response) ->_setInvokeArgs($invokeArgs); $this->_helper = new Zend_Controller_Action_HelperBroker($this); $this->init(); }
大家对ZF都没研究吗? 还是ZF太LJ - -!
PHP 5 introduces Type Hinting. Functions are now able to force parameters to be objects (by specifying the name of the class in the function prototype) or arrays (since PHP 5.1). 5.1 才能用.
官方的 quickstart文档这样写的, 他说PHP5, 没说版本Zend Framework is an open source, object oriented web application framework for PHP 5. ZF is often called a 'component library', because it has many loosely coupled components that you
不需要申明变量类型的, 你直接$arr = array();即可
$arr=array();即可
如果我把前面的array去掉后正常, 那是多么大的工程啊, public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
{
$this->setRequest($request)
->setResponse($response)
->_setInvokeArgs($invokeArgs);
$this->_helper = new Zend_Controller_Action_HelperBroker($this);
$this->init();
}
官方的 quickstart文档这样写的, 他说PHP5, 没说版本Zend Framework is an open source, object oriented web application framework for PHP 5. ZF is often called a 'component library', because it has many loosely coupled components that you