Edit report at https://bugs.php.net/bug.php?id=42472&edit=1

 ID:                 42472
 Comment by:         aminviral2006 at gmail dot com
 Reported by:        jsnell at e-normous dot com
 Summary:            $_SESSION[false] = 1; Notice: Unknown: Skipping
                     numeric key 0. in Unknown on
 Status:             Not a bug
 Type:               Bug
 Package:            Session related
 Operating System:   10.4.10
 PHP Version:        5.2.3
 Block user comment: N
 Private report:     N

 New Comment:

Hi,
I just encountered with this problem.
my session was like $_SESSION[0]['someid']

and i changed it to $_SESSION['someid'][0]
now it works fine.

Hope this helps you


Previous Comments:
------------------------------------------------------------------------
[2011-05-17 19:39:10] fgutierrez at ticomotorsports dot com

This is clearly a bug in PHP.

The answer from j...@php.net leaves too much to desire. Seems like jani was 
"washing their hands" and leaving the problem to anyone else.

------------------------------------------------------------------------
[2007-08-30 09:16:06] j...@php.net

Rebogused: This is not possible to change and that's how it works.


------------------------------------------------------------------------
[2007-08-29 20:57:19] nfor...@php.net

This isn't exactly the problem. The problem is that the error 
message produced is incorrect -- not that the error shouldn't occur. 
It should not have an unknown file and a 0 line number, but rather 
the file and line number where the error occurred.

This is probably superglobal-array-specific, and seems to apply to 
any numeric key.

Reopening.

------------------------------------------------------------------------
[2007-08-29 20:23:52] j...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

false/true/null/etc are not valid key names. Please read the manual for what is 
valid and what isn't. This is no bug.

------------------------------------------------------------------------
[2007-08-29 17:05:02] jsnell at e-normous dot com

Description:
------------
Attempting to use an array key of false on $_SESSION after a session has 
been started causes a notice without sufficient information to fix the 
problem.

Also tested in latest CVS: PHP 5.2.4RC4-dev (cgi) (built: Aug 29 2007 
11:53:35)

Reproduce code:
---------------
error_reporting(E_ALL);
session_start();
$_SESSION[false] = 1;

Expected result:
----------------
Notice: Unknown: Skipping numeric key 0. in test.php on line 3

Actual result:
--------------
Notice: Unknown: Skipping numeric key 0. in Unknown on line 0


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



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

Reply via email to