#39202 [Bgs]: Temporary tables with references dereference
| From: | tony2001@php.net | Date: | Fri, 20 Oct 2006 17:15:13 +0000 |
| Subject: | #39202 [Bgs]: Temporary tables with references dereference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103812@lists.php.net to get a copy of this message | ||
ID: 39202
Updated by: tony2001@php.net
Reported By: cpriest at warpmail dot net
Status: Bogus
Bug Type: Arrays related
Operating System: Apache 2.0.55
PHP Version: 5.1.6
New Comment:
Where did you manage to find THREE objects here?
Array
(
[Test] => myClassA Object
(
[Name] => Object 3
)
[Test2] => myClassA Object
(
[Name] => Object 2
)
)
Previous Comments:
------------------------------------------------------------------------
[2006-10-20 17:04:26] cpriest at warpmail dot net
> It does, but you call print_r() BEFORE changing it =)
I'm calling print_r() twice, once before and once after. The before
shows correctly the after shows three objects exist... What am I
missing?
------------------------------------------------------------------------
[2006-10-20 16:15:24] tony2001@php.net
>it doesn't change the real object.
It does, but you call print_r() BEFORE changing it =)
------------------------------------------------------------------------
[2006-10-20 16:07:16] cpriest at warpmail dot net
I think there's some confusion here, if you look at the code source I
am only creating two objects. When I call getReferenced() it returns a
table which has references to the created objects.
When I go to change the name of the object in the second table (the one
with references) it doesn't change the real object. For some reason
there are then three objects when only two have been created.
If this is the expected behavior can you explain why? I don't
understand why a third object is being created when I have used
references.
------------------------------------------------------------------------
[2006-10-20 08:42:56] tony2001@php.net
See my explanation in the previous message.
No bug here.
------------------------------------------------------------------------
[2006-10-20 00:18:12] cpriest at warpmail dot net
Expected:
------------------------------------------
Array
(
[Test] => myClassA Object
(
[Name] => Object 3
)
[Test2] => myClassA Object
(
[Name] => Object 2
)
)
Array
(
[Test] => myClassA Object
(
[Name] => Object 3
)
[Test2] => myClassA Object
(
[Name] => Object 2
)
)
Actual:
--------------------------------------------
Array
(
[Test] => myClassA Object
(
[Name] => Object 1
)
[Test2] => myClassA Object
(
[Name] => Object 2
)
)
Array
(
[Test] => myClassA Object
(
[Name] => Object 3
)
[Test2] => myClassA Object
(
[Name] => Object 2
)
)
------------------------------------------------------------------------
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/39202
--
Edit this bug report at http://bugs.php.net/?id=39202&edit=1