ID: 32261 Updated by: [EMAIL PROTECTED] Reported By: takayana at egate1 dot com -Status: Verified +Status: Assigned Bug Type: Session related Operating System: * PHP Version: 4CVS-2005-03-23 -Assigned To: +Assigned To: derick New Comment:
Assigning to Derick (another reference thing..) Previous Comments: ------------------------------------------------------------------------ [2005-03-25 02:40:34] takayana at egate1 dot com In my long code Result at the time of performing by PHP4.3.9 The normal value outputted and I thought that it was the problem of PHP4.3.10. It seems that it is the same when the code of bug #24485 is seen. Are they things even if it becomes easier to find a bug in PHP4.3.10? ------------------------------------------------------------------------ [2005-03-24 21:49:06] [EMAIL PROTECTED] bug #24485 seems to be same issue as this. ------------------------------------------------------------------------ [2005-03-24 08:08:16] takayana at egate1 dot com If it can do With PHP4.X I would like you to carry out fix. ------------------------------------------------------------------------ [2005-03-24 07:46:37] [EMAIL PROTECTED] Seems also to be fixed in HEAD (PHP 5.1.0-dev) ------------------------------------------------------------------------ [2005-03-23 01:29:49] [EMAIL PROTECTED] Here's the shortest possible example script I came up with, which does exactly same as your multiple scripts plus shows what really happens: <?php class data {var $f;} session_start(); $phase = isset($_GET['phase']) ? $_GET['phase'] : 1; switch ($phase) { case 1: $_SESSION['foo'][0] = new data; $_SESSION['foo'][0]->f = 1; $_SESSION['foo'][1] = new data; $_SESSION['foo'][1]->f = 2; header("Location: test_web.php?phase=2"); exit(1); break; case 2: $_SESSION['bar'] = new data; $_SESSION['bar']->f = 3; header("Location: test_web.php?phase=3"); exit(1); break; case 3: $_SESSION['foo'][0] = $_SESSION['bar']; // Here be bug header("Location: test_web.php?phase=4"); exit(1); break; case 4: $_SESSION['bar'] = 'foo'; header("Location: test_web.php?phase=5"); exit(1); break; case 5: echo '<pre>'; var_dump($_SESSION); echo '</pre>'; break; } ?> Output is this: array(2) { ["foo"]=> array(2) { [0]=> &string(3) "foo" [1]=> object(data)(1) { ["f"]=> int(2) } } ["bar"]=> &string(3) "foo" } Result: ['bar'] became a reference to ['foo'][0] (Does NOT happen when using arrays instead of object) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/32261 -- Edit this bug report at http://bugs.php.net/?id=32261&edit=1