Home >Backend Development >PHP Tutorial >php什么时候该传值还是传引用

php什么时候该传值还是传引用

WBOY
WBOYOriginal
2016-06-23 13:41:011004browse

1:要改变原来的值

$a  = 'www.myfreax.com';function change(&$a){    $a = 'huangyanxiong';}change($a);echo $a;



2:特大的数组

每创建一个变量就会划分一个内存空间

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
Previous article:新人求教headerNext article:PHP curl登录访问