|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-25 18:24 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 17:00:01 2025 UTC |
Description: ------------ When a class is instantiated globally, and assigned to a variable name which is the same as a session variable, then the session variable get overwritten with the class. This may happen with non-class variables, but I am not sure. Reproduce code: --------------- changing $entrain to anything else (i.e. $entra) fixes the problem. <?php session_start(); $entrain = new entrainRuntime(); var_dump($_SESSION); class entrainRuntime { function entrainRuntime () { $_SESSION['entrain'] = array(); } } ?> Expected result: ---------------- array(1) {"entrain" => array(0) {}} this happens the first time, expected Actual result: -------------- On subsequent refreshes: array(1) {"entrain" => &bject(entrainruntime)(0) {}}