聘我网

新概念招聘3.0

这个方法定义什么意思?

vote up0vote downstar
public function & get($name, $default = null)

其中&是什么意思?

 

1 个答复

vote up0vote downcheck

表示返回结果为引用而不是一个拷贝

参考资料

$foo = 'foo'; 

function & get_foo_ref () 
{ 
  global $foo; 
  return $foo; 
} 

// Get the reference to variable $foo stored into $bar 
$bar = & get_foo_ref(); 
$bar = 'bar'; 

echo $foo;

结果为

bar
链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.