Odd array_push issue

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

 



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.

-- 
Sláinte,
Richard S. Crawford (richard@xxxxxxxxxxxxx)
http://www.underpope.com

[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