ID:               37229
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mcsimm at inbox dot ru
-Status:           Open
+Status:           Feedback
 Bug Type:         Session related
 Operating System: FreeBSD 5.4-RELEASE
 PHP Version:      4.4.2
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Can't reproduce


Previous Comments:
------------------------------------------------------------------------

[2006-04-27 22:47:50] judas dot iscariote at gmail dot com

your test produces the "expected result" in current 5.2.0-dev CVS.

------------------------------------------------------------------------

[2006-04-27 22:33:27] mcsimm at inbox dot ru

Description:
------------
When keeping copyies of $_SESSION array its values are copied as
references.

Bug has found in version 4.4.2 (FreeBSD)
In version 4.3.10 (Windows) this work correctly.

Reproduce code:
---------------
<?php
session_start();
$test_array = array();

$_SESSION['var'] = 'first';
$copy1 = $_SESSION;

$_SESSION['var'] = 'second';
$copy2 = $_SESSION;

var_dump($copy1);
var_dump($copy2);
?>

Expected result:
----------------
array(1) {
  ["var"]=>
  string(5) "first"
}
array(1) {
  ["var"]=>
  string(6) "second"
}

Actual result:
--------------
array(1) {
  ["var"]=>
  &string(6) "second"
}
array(1) {
  ["var"]=>
  &string(6) "second"
}


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37229&edit=1

Reply via email to