note 40538 added to ref.session

From: Date: Sun, 07 Mar 2004 02:03:24 +0000
Subject: note 40538 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-66373@lists.php.net to get a copy of this message
Having numbers (where the type is string) as keys in the first dimension in $_SESSION will cause some weird behaviour when adding new content, like this: <?php $_SESSION['1234567'] = "some value"; ?> Sometimes, pretty often actually, it will cause the last place to be overwritten instead of just adding it to the end. Possible solutions are: <?php //add some text to the number $_SESSION['text_1234567'] = "some value"; //or, add a dimension $_SESSION['text']['1234567'] = "some value"; ?> I don't know if this is a bug or it's supposed to be like this, but in any way php does not display any error messages even if one has set it to show all errors. ---- Manual Page -- http://www.php.net/manual/en/ref.session.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40538 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40538&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40538&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66373) next »