Home > Backend Development > PHP Tutorial > Detailed explanation of value assignment in php

Detailed explanation of value assignment in php

怪我咯
Release: 2023-03-14 06:40:01
Original
1294 people have browsed it

Assignment is the most commonly used basic knowledge point in PHP development. Assignment in PHP is divided into passing valueassignment and referenceassignment. Let’s take a look at it below. Look at the concept of assignment by value

Assignment by value: assigning the value of the actual parameter to the row parameter, then modification of the row parameter will not affect the value of the actual parameter.
For example: the root copy is the same. For example, I have a house. I give you building materials. You build a house that is exactly the same as mine. Whatever you do in your house will not affect me. What I do in my house will not affect me. Nothing will affect you, independent of each other.

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy(&#39;copy8116&#39;)">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy8116>$aa=1;
$bb=2;
$aa=$bb;//$aa和$bb互不相干
$aa=3;
echo $aa,&#39;--&#39;,$bb;//输出3--2
</td> </tr> </table>
Copy after login

The above is the detailed content of Detailed explanation of value assignment in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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