<code> /** * 获取各请求方法PV数 * * @param integer $interval 周期间隔 * @param string $referenceTime 基准时间 * @param array $domains 域名列表 * @param array $paths 路径列表 * @param array $methods 请求方法列表 * @param string $pvCountOrder PV数排序 - 正序:ASC 倒序:DESC * @param integer $offset 结果偏移 * @param integer $limit 结果数量 * @param boolean &$total 结果总数 * @return array PV数列表 */ public function getPvCountForMethods( $interval, $referenceTime, $domains = array(), $paths = array(), $methods = array(), $pvCountOrder = 'DESC', $offset = 0, $limit = -1, &$total = false ) { // 确定请求方法PV日志表 $logTable = $paths</code>
<code> /** * 获取各请求方法PV数 * * @param integer $interval 周期间隔 * @param string $referenceTime 基准时间 * @param array $domains 域名列表 * @param array $paths 路径列表 * @param array $methods 请求方法列表 * @param string $pvCountOrder PV数排序 - 正序:ASC 倒序:DESC * @param integer $offset 结果偏移 * @param integer $limit 结果数量 * @param boolean &$total 结果总数 * @return array PV数列表 */ public function getPvCountForMethods( $interval, $referenceTime, $domains = array(), $paths = array(), $methods = array(), $pvCountOrder = 'DESC', $offset = 0, $limit = -1, &$total = false ) { // 确定请求方法PV日志表 $logTable = $paths</code>
& represents a reference to a variable in PHP.
Putting it in this code means that the pointer inside the parameter $total points to the place passed.
The PHP interpreter will not register a new variable $total in the body of this function, but directly refers to the place passed The $total variable,
If the value of $total is modified within the function body, the $total outside will also change accordingly
example:
<code><?php $a = 1; function foo(&$var) { return $var = $var + 10; } echo foo($a);//11 echo $a; //11 ?></code>
There are two simple types of transfer
One is value transfer
The other is reference transfer
&It is reference transfer
Should you pass by value or by reference? &$total means passing the address of $total
Look at this: This is a manual
Then, git blame filename
, find the author, and beat him to death.
Supports blame killing, 9 parameters...
Reference transfer can be regarded as a pointer, pointing to the same memory address
Quote
Function:
<code>修改同一个值,因为内存地址是一样的</code>