List Info

Thread: note 78389 added to language.oop5.basic




note 78389 added to language.oop5.basic
user name
2007-10-09 23:41:18
The following odd behavior happens in php version 5.1.4 (and
presumably some other versions) that does not happen in php
version 5.2.1 (and possibly other versions > 5.1.4).

<?php

$_SESSION['instance']=...;

$instance=new SomeClass;

?>

The second line will not only create the $instance object
successfully, it will also modify the value of
$_SESSION['instance']!

The workaround I arrived at, after trial and error, was to
avoid  using object names which match a $_SESSION array
key.

This is not intended to be a bug report, since it was
apparently fixed by version 5.2.1, so it's just a workaround
suggestion.
----
Server IP: 69.147.83.197
Probable Submitter: 76.201.152.69
----
Manual Page -- 
http://www.php.net/manual/en/language.oop5.basic.php
Edit        -- https://master
.php.net/note/edit/78389
Del: integrated  -- h
ttps://master.php.net/note/delete/78389/integrated
Del: useless     -- http
s://master.php.net/note/delete/78389/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78389/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78389/spam
Del: non-english -- 
https://master.php.net/note/delete/78389/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78389/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78389
Reject      -- https://mast
er.php.net/note/reject/78389
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )