ID: 17122 Comment by: kjf at mac dot com Reported By: mats at cdmedia dot nu Status: Closed Bug Type: Documentation problem Operating System: Linux RH 7.2 PHP Version: 4.2.0 New Comment:
numeric keys may not be supported, but lets say you do: $_SESSION[4]='something'; $_SESSION['four']='something'; you will lose both session keys in the next load. in other words, any session key/value pair created in the script after the numeric key are lost, but the ones before are kept. Previous Comments: ------------------------------------------------------------------------ [2002-10-03 22:13:57] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Added comment on the limitations for variable names in the documentation. ------------------------------------------------------------------------ [2002-09-30 09:23:41] research at information4u dot com I've been having a similar problem for over a week. Tried everything I could think of. Script looked like this: <? GLOBAL $HTTP_SESSION_VARS; session_start(); $AVAR += 1; session_register('AVAR'); print "<p>variable={$HTTP_SESSION_VARS['AVAR']}</p>"; ?> Seemed everyone else could get it to work except for a friend and I. I'm using IE 6.0.28, he's using Netscape 4.04. I was able to correct the problem by doing the following while running IE6.0.28: a) Select Tools/Internet Options b) Select Privacy Tab c) Click on Advanced button d) Check Override Automatic Cookie Handling e) Check Always allow session cookies After doing this - everything worked fine - even the test scripts above (except for the variable 4). I then went back and unchecked the Override Automatic Cookie Handling - assuming that this would return me back to a state where AVAR would not increment. Much to my chagrin, it continued to work. This leads me to believe that there's a registry setting somewhere that controls this behavior. Now, to find out what it is and how to check for it on a user's machine from within PHP..... ------------------------------------------------------------------------ [2002-07-08 09:35:24] scott at abcoa dot com This test case I posted is with register_global turned off. Well, the documentation should stated that the number can not be used as the first character. I wonder how can anyone tell the difference on $_SESSION from an array? It look a lot like an array in some way. ------------------------------------------------------------------------ [2002-07-05 15:50:47] [EMAIL PROTECTED] As session variables are subject to be registered as global variables (if register_globals is on), and identifier names (including variable names) cannot begin with a numeric character, it's not too hard to see that session variables should not begin with a number. Basically session variables should follow naming ruiles for identifiers IMHO. ------------------------------------------------------------------------ [2002-07-05 15:46:23] scott at abcoa dot com Whoop! One more thing! $_SESSION[CUSTOMER_ID] does work on page 1 also! Didn't include that as Example #3 on page 1. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17122 -- Edit this bug report at http://bugs.php.net/?id=17122&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php