ID: 33129
User updated by: ariel at liveinteractive dot net
-Summary: Error creatin object not asigned with array parameters
Error
Reported By: ariel at liveinteractive dot net
Status: Open
Bug Type: Class/Object related
Operating System: Fedora
PHP Version: 4.3.11
New Comment:
.
Previous Comments:
------------------------------------------------------------------------
[2005-05-24 18:40:28] ariel at liveinteractive dot net
Description:
------------
If I create an object without asign it wich creator function receive an
array of created objects, the last object of the array is replaced with
an object *RECURSION*
If I assign the new object it works fine.
I have the same problem with PHP 4.3.10
./configure \
--enable-xml \
--enable-wddx \
--enable-bcmath=shared \
--enable-calendar=shared \
--enable-track-vars \
--enable-trans-sid \
--with-gd \
--with-mysql \
--with-libxml-dir=/usr/local \
--with-jpeg-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-mcrypt=/usr/lib \
--with-zlib \
--with-zlib-dir=/usr/lib \
--enable-sockets \
--with-apxs=/usr/local/apache/bin/apxs
Reproduce code:
---------------
<?php
echo "<pre>";
class A
{
function A($a)
{
print_r($a);
}
}
class B
{
var $b;
function B($b)
{
$this->b = $b;
print_r($this);
}
}
/* $j = */new A(array(new B('1'), new B('2')));
?>
Expected result:
----------------
b Object
(
[b] => 1
)
b Object
(
[b] => 2
)
Array
(
[0] => b Object
(
[b] => 1
)
[1] => b Object
(
[b] => 2
)
)
Actual result:
--------------
b Object
(
[b] => 1
)
b Object
(
[b] => 2
)
Array
(
[0] => b Object
(
[b] => 1
)
[1] => b Object
(
[b] => *RECURSION*
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33129&edit=1