什么';PHP函数前的s常量';s参数


What's constant before PHP function's param

我在Kohana用户指南中看到:http://kohanaframework.org/3.0/guide/kohana/mvc/controllers#custom-构造函数

Custom __construct()函数行中,您可以在构造函数中看到如下参数:

function __construct(Kohana_Request $request)

所以,我们在第一个参数Kohana_Request中有一个常数。请帮我理解它是什么。

感谢

不是常量,它是一个类型提示:http://www.php.net/manual/en/language.oop5.typehinting.php

$request应该是类型为Kohana_Request的对象。