Bug #68145 [Com]: For + Array declaration inside

From: Date: Fri, 03 Oct 2014 15:52:51 +0000
Subject: Bug #68145 [Com]: For + Array declaration inside
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187821@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68145&edit=1 ID: 68145 Comment by: renzo dot disalvo at gmail dot com Reported by: renzo dot disalvo at gmail dot com Summary: For + Array declaration inside Status: Open Type: Bug Package: Scripting Engine problem Operating System: Ubuntu 12.04 LTS (GNU/Linux 3.2 PHP Version: 5.5.17 Block user comment: N Private report: N New Comment: Ok resolved but I don't know if is a bug, Never mix object and array mixed together. The strange think the output was correct but outside of the for the array become corrupted. R Previous Comments: ------------------------------------------------------------------------ [2014-10-03 14:53:08] renzo dot disalvo at gmail dot com Description: ------------ I'm trying to generate some values and after assign to the array, The strange think is when I print out the output is totally different. In the final array I can see duplicate, but the original assignment is unique. Test script: --------------- for ($i = 1; $i <= 10; $i++) { $question = $this->getRandomQuestion(); print_r($question->data['name']); // return Correct Name $arrQuestion[$i] = $question; print_r($arrQuestion[$i]->data['name']); //Return Correct name print_r("\n"); } print_r($arrQuestion[1]); //Return Different Value ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68145&edit=1

« previous php.bugs (#187821) next »