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

WBOY
Release: 2016-06-23 13:47:28
Original
1929 people have browsed it

网上定义是“$a=&$b;意味着$a和$b指向同一个变量,这里$a,$b是完全相同的,并不是$a指向$b或者相反”
那我还有个疑问,
        $b = 50;
        $b = &$a;
        echo $a;
?>
为什么无输出?
ps:新人我刚学php,问题有点2见谅些


回复讨论(解决方案)

你写 反了吧!!你的$a根本没有初始化,就赋值给$b,当然无输出了

 $b = 50;        $a = &$b;        echo $a;
Copy after login

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