Home > Backend Development > PHP Tutorial > java软件工程师学php -13. 值传递与引用传递

java软件工程师学php -13. 值传递与引用传递

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 13:11:23
Original
1043 people have browsed it

java程序员学php -13. 值传递与引用传递
php和Java一样,调用函数时,基本数据类型用值传递,对象用引用传递

但php也可以传递基本数据类型的引用(用&符号):


$w = 65; 
function change_it(&$weight){
   $weight = 60;
}

change_it($w);
echo $w; //60


Copy after login

Related labels:
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
Latest Issues
How to change it?
From 1970-01-01 08:00:00
0
0
0
Change mysql password
From 1970-01-01 08:00:00
0
0
0
How to change the PHP UPDATA statement
From 1970-01-01 08:00:00
0
0
0
Can the php toolbox change the mysql version?
From 1970-01-01 08:00:00
0
0
0
Change nuxt js Auth cookies name
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template