||
解决办法:php5.3开始后,废除了php中的”=&”符号,所以要想复制,直接使用 "=" 引用即可。
After hours of confusion and reading tons of posts I finally figured out that replacing PHP 4 style object creation, where new is assigned by reference:
$node_obj =& new someClass($somearg, $moreargs);
which in PHP 5.3.0 generates an E_STRICT message telling you that "Assigning the return value of new by reference is deprecated"
with the following, where & has been removed:
$node_obj = new someClass($somearg, $moreargs);
in some cases (at least in recursive loops while creating a tree of nodes containing child nodes) requires
unset($node_obj);
before the actual object assignment line to avoid all child nodes becoming identical.
Hope that delicate piece of information will save someone else a few hours.
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-1 01:22
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社