ID: 43983 User updated by: rubens21 at gmail dot com Reported By: rubens21 at gmail dot com -Status: No Feedback +Status: Open Bug Type: Scripting Engine problem PHP Version: 5.2.5 New Comment:
"What does it output when you replace print_r() with var_dump() ?" R: The same Previous Comments: ------------------------------------------------------------------------ [2008-02-09 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2008-02-01 22:28:15] [EMAIL PROTECTED] What does it output when you replace print_r() with var_dump() ? ------------------------------------------------------------------------ [2008-01-30 15:40:53] rubens21 at gmail dot com This example is more simple: $test = new stdClass(); $Objeto = new stdClass(); $test->valor = "The first value"; $Objeto->valorDeTeste[] = $test; $test->valor = "The second value"; print_r($Objeto->valorDeTeste); Expected: Array ( [0] => stdClass Object ( [valor] => The first value ) ) Actual Array ( [0] => stdClass Object ( [valor] => The second value ) ) ------------------------------------------------------------------------ [2008-01-30 15:37:54] rubens21 at gmail dot com Description: ------------ change atribute of a class, and arrays that received values is change too. I know that the bug #33207 (http://bugs.php.net/bug.php?id=33207&edit=2) describes this same problem, but there is not the solution and the id of the other related. Reproduce code: --------------- $test = new stdClass(); $Objeto = new stdClass(); $test->valor = "No Change!"; $Objeto->valorDeTeste[] = $test; $test->valor = "Yes, change!"; $Objeto->valorDeTeste[] = $test; print_r($Objeto->valorDeTeste); Expected result: ---------------- Array ( [0] => stdClass Object ( [valor] => No Change! ) [1] => stdClass Object ( [valor] => Yes, change! ) ) Actual result: -------------- Array ( [0] => stdClass Object ( [valor] => Yes, change! ) [1] => stdClass Object ( [valor] => Yes, change! ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43983&edit=1