ID:               26278
 Updated by:       [EMAIL PROTECTED]
 Reported By:      glumtail at yahoo dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Session related
 Operating System: FreeBSD
 PHP Version:      4.3.2
 New Comment:

Of course you can't.

RTFM (http://www.php.net/session):

"The keys in the $_SESSION associative array are subject to the same
limitations as regular variable names in PHP, i.e. they cannot start
with a number and must start with a letter or underscore. For more
details see the section on variables in this manual."


Previous Comments:
------------------------------------------------------------------------

[2003-11-16 20:01:32] glumtail at yahoo dot com

Description:
------------
I found it can not save integer variable in session.
e.g:
  $_SESSION['TEST'] = 'SOMETHING'  // OK
  $_SESSION[1]      = 'SOMETHING'  // ERROR

My environment: FreeBSD + PHP 4.3.2
I think it must be a BIG bug.

Reproduce code:
---------------
<?php
session_start();
print_r($_SESSION); // always can not print $_SESSION[1]

$_SESSION[1]      = 'TEST';
$_SESSION['TEST'] = 'MY TEST';
print_r($_SESSION);
?>

Expected result:
----------------
Result (after refresh):
Array ( )
Array ( [1] => TEST [TEST] => MY TEST )


The correct result should be:
Array ( [1] => TEST [TEST] => MY TEST )
Array ( [1] => TEST [TEST] => MY TEST )



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26278&edit=1

Reply via email to