ID: 39202
User updated by: cpriest at warpmail dot 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:
> 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?
Previous Comments:
------------------------------------------------------------------------
[2006-10-20 16:15:24] [EMAIL PROTECTED]
>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] [EMAIL PROTECTED]
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
)
)
------------------------------------------------------------------------
[2006-10-19 21:11:57] [EMAIL PROTECTED]
Can't reproduce.
After the first print_r() I see "Object 1" (because the object haven't
been changed yet), after ther second call I get "Object 3", which is
expected too.
Hint: when we say "expected and actual results" we usually mean
"copy/paste what you see and also attach what you expected to see", not
a "I expect to see ..".
------------------------------------------------------------------------
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