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

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

WBOY
Release: 2016-06-23 13:41:01
Original
1010 people have browsed it

1:要改变原来的值

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



2:特大的数组

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template