Home  >  Article  >  Backend Development  >  函数返回引用解决方法

函数返回引用解决方法

WBOY
WBOYOriginal
2016-06-13 12:20:21790browse

函数返回引用
function &bar()
{
    $a = 5;
    return $a;
}
$c=bar();
echo $c;
上面的函数不是运行完毕 函数体的变量不是给释放了 怎么返回的引用还有效呢?
------解决思路----------------------
运行结果不是5么?你return 返回给$c了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn