|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-25 11:27 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
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* ) )