#38875 [Bgs]: no new variables possible after self::$var = $_SESSION
| From: | lagemann at x-wars dot net | Date: | Tue, 19 Sep 2006 20:10:03 +0000 |
| Subject: | #38875 [Bgs]: no new variables possible after self::$var = $_SESSION | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-102445@lists.php.net to get a copy of this message | ||
ID: 38875
User updated by: lagemann at x-wars dot net
Reported By: lagemann at x-wars dot net
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Gentoo 3.3.6, ssp-3.3.6-1.0, pie
PHP Version: 5.1.6
New Comment:
Hm, i think its not really a good behaviour that i after
some calls can't use new variables in methods. Perhaps it
could be a better way to throw an exception, warning or
error if I'm trying to assign the magic then
doing "nothing" :-).
Previous Comments:
------------------------------------------------------------------------
[2006-09-19 06:17:56] tony2001@php.net
.
------------------------------------------------------------------------
[2006-09-18 23:40:09] judas dot iscariote at gmail dot com
yu cannot do this :
$var = $_SESSION;
or
$_SESSION = array(1,2,3,4,5);
because $_SESSION loose it's "magical" atributes then. and that is, the
expected behaviuor.
------------------------------------------------------------------------
[2006-09-18 22:22:19] lagemann at x-wars dot net
Description:
------------
I set a static class var to $_SESSION ($varname
= 'SESSION'; self::$$varname = $_SESSION;) and after some
method calls and requires no new variable can be set in a
method of the class.
This problem occurs not if i set self::$$varname =
&$_SESSION;
tested with php 5.1.4, 5.1.6 and php 5.2.0RC5-dev
(php5.2-200609172030)
Reproduce code:
---------------
Some more lines than 20:
http://degola.de/phpbug/
Expected result:
----------------
in line 41 the variable $classArray have to be Array ()
Actual result:
--------------
no new variable can be set, see http://degola.de/phpbug/
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38875&edit=1