|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-29 01:09 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 23:00:01 2025 UTC |
Description: ------------ Let's say I have a class c1. Doing this: $obj = &$_SESSION['obj']; $obj = &new c1(); would set $_SESSION['obj'] to NULL. Reproduce code: --------------- <?php class c1 { var $v; function c1($a) { $this->v = $a; } function say() { print "{$this->v}<br>"; } } session_start(); session_destroy(); $obj = &$_SESSION['aaa']; $obj = &new c1(6); var_dump($_SESSION['aaa']); ?> Expected result: ---------------- I would expect to have an object in the $_SESSION['aaa'] Actual result: -------------- The actual result is NULL. Sorry if this is post in not pertinent but I haven't found any support related to this.