Re: Odd array_push issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 May 2011 22:23, Richard S. Crawford <richard@xxxxxxxxxxxxx> wrote:
> I'm encountering what appears to be a bug in array_push when I try using
> that function to add objects to an array. For example...
>
> A = Object 1
> B = Object 2
>
> If I execute the following code:
>
> array_push(objectarray, A);
> array_push(objectarray, B);
>
> ...I expect the contents of $objectarray to be:
>
> [0] = A
> [1] = B
>
> Instead, the last object pushed onto the array is repeated throughout the
> array. In other words, instead of the above, I get this:
>
> [0] = B
> [1] = B
>
> Can anyone enlighten me as to why this is happening? I've looked through bug
> reports but haven't found anything, which leads me to think that perhaps my
> own code is at fault.
>

If you could post some more of your code, it would be easier to check
if your code is at fault or not.

Regards
Peter

-- 
<hype>
WWW: plphp.dk / plind.dk
LinkedIn: plind
BeWelcome/Couchsurfing: Fake51
Twitter: kafe15
</hype>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux