#20993 [Opn]: Element value changes without asking
| From: | nlopess@php.net | Date: | Sat, 17 Apr 2004 15:59:57 +0000 |
| Subject: | #20993 [Opn]: Element value changes without asking | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969360150@lists.php.net to get a copy of this message | ||
ID: 20993
Updated by: nlopess@php.net
Reported By: henrik dot gebauer at web dot de
Status: Open
Bug Type: Documentation problem
Operating System: Any
PHP Version: 4.0CVS-2002-12-13
New Comment:
As you may have noted, we have more than 100 open bugs, so its hard to
response quickly.
However, if you want to submit a patch to the documentation, we are
open to contributions.
Previous Comments:
------------------------------------------------------------------------
[2004-04-16 22:59:25] php dot devel at homelinkcs dot com
I don't wish to generate unnecessary traffic, however, I
have been unable to find any reference to this issue in
the current documentation at http://www.php.net/manual.
Since, it's been well over a year since this issue (and
several related bug reports) has been brought up, can
anyone give me an update on this it's status? I consider
this a serious problem because, IMHO, the behavior seems
illogical from a high-level view of references and copies
(cf (from chapter 7 of the manual): "[A]fter assigning one
variable's value to another, changing one of those
variables will have no effect on the other."). For that
reason, furthermore, lack of knowedge of this behavior
can make code affected by it quite difficult to debug.
------------------------------------------------------------------------
[2002-12-18 03:25:45] msopacua@php.net
We have discussed this issue and it will put a considerable slowdown on
php's performance, to fix this properly.
Therefore this behavior will be documented.
------------------------------------------------------------------------
[2002-12-13 14:51:47] moriyoshi@php.net
This bug has a lot to do with the bug reports mentioned below.
http://bugs.php.net/bug.php?id=6417
http://bugs.php.net/bug.php?id=7412
http://bugs.php.net/bug.php?id=15025
As a workaround, you can write as following to avoid this issue.
function theFunction($array) {
$array = unserialize(serialize($array));
$array[0] = 2;
}
------------------------------------------------------------------------
[2002-12-13 12:50:26] moriyoshi@php.net
Verified with 4.2.3
------------------------------------------------------------------------
[2002-12-13 12:42:22] msopacua@php.net
Verified and added testcase to CVS
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/20993
--
Edit this bug report at http://bugs.php.net/?id=20993&edit=1