FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » ArrayObject - copy or reference
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
ArrayObject - copy or reference [message #175050] Mon, 08 August 2011 17:28 Go to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
Please consider the following example code:

$array = array( 1, 2, 3 );
$obj = new ArrayObject( $array );
$obj[0] = 42;
echo $array[0];

With PHP 5.2.0 this prints 42, with PHP 5.2.4 however, I get 1 (as
expected). I have searched both on PHP's changelog [1] and Google, but
could not find any information about this issue. I assume it is a bug
that was fixed, but which one and in which version?

Greetings,
Thomas

[1] <http://php.net/ChangeLog-5.php>


--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Freelance PHP Developer
Next Topic: How to integrate paypal payment Indian currency support ..?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 03:23:38 GMT 2024

Total time taken to generate the page: 0.04709 seconds