ID:               27078
 User updated by:  rob dot brenart at tradingtechnologies dot com
 Reported By:      rob dot brenart at tradingtechnologies dot com
 Status:           Bogus
 Bug Type:         Session related
 Operating System: Windows XP
 PHP Version:      4.3.4
 New Comment:

My mistake, I looked and missed it.  But then shouldn't this kick out a
warning on the $_SESSION[167]='hi world'; line?


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

[2004-01-28 14:39:40] [EMAIL PROTECTED]

No, they're not allowed, RTFM:

"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."


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

[2004-01-28 14:30:27] rob dot brenart at tradingtechnologies dot com

Description:
------------
Perhaps it's intentional as variables aren't supposed to be numeric,
but seeing as it's the $_SESSION array, I figured this would be
allowed.  

Reproduce code:
---------------
<?php
session_start();

echo '<pre>';
print_r($_SESSION);
echo '<hr>';
$_SESSION[167]='hi world';
print_r($_SESSION);

echo '<a href="test1.php">Here ya go</a>';

?>

Expected result:
----------------
Array
(
    [167] => hi world
)Array
(
    [167] => hi world
)

Here ya go

Actual result:
--------------
Array
(
)
Array
(
    [167] => hi world
)

Here ya go


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


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

Reply via email to