在php中$a=&$b;跟$b=&$a;区别

WBOY
Release: 2016-06-13 12:08:07
Original
1389 people have browsed it

在php中$a=&$b;和$b=&$a;区别
网上定义是“$a=&$b;意味着$a和$b指向同一个变量,这里$a,$b是完全相同的,并不是$a指向$b或者相反”
那我还有个疑问,
        $b = 50;
        $b = &$a;
        echo $a;
?>
为什么无输出?
ps:新人我刚学php,问题有点2见谅些
------解决思路----------------------
你写 反了吧!!你的$a根本没有初始化,就赋值给$b,当然无输出了

<br /> $b = 50;<br />        $a = &$b;<br />        echo $a;<br />
Copy after login

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