#24565 [Opn->Ver]: cannot read array elements recived via $_REQUEST
| From: | sniper@php.net | Date: | Wed, 09 Jul 2003 21:00:14 +0000 |
| Subject: | #24565 [Opn->Ver]: cannot read array elements recived via $_REQUEST | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-43575@lists.php.net to get a copy of this message | ||
ID: 24565
Updated by: sniper@php.net
Reported By: nightcat at poczta dot onet dot pl
-Status: Open
+Status: Verified
Bug Type: Zend Engine 2 problem
-Operating System: Windows XP
+Operating System: *
-PHP Version: 5CVS-2003-07-09 (dev)
+PHP Version: 5.0.0b2-dev
New Comment:
Reproduced with latest PHP 5 CVS. Works fine with PHP 4.3.3RC2-dev.
Previous Comments:
------------------------------------------------------------------------
[2003-07-09 15:05:28] tingle at virtuanews dot co dot uk
Confirmed using Apache 2.0.46, Windows XP SP1 and the latest snapshot
(php5-win32-200307091830.zip)
Identical problem as stated
print_r() gives the expected output with the expected keys and values,
however, trying to reference the key within the code results in it not
being set
------------------------------------------------------------------------
[2003-07-09 11:16:27] nightcat at poczta dot onet dot pl
Description:
------------
In PHP5 yesterdays snapshot i'm unable to get array element created by
POST/GET method.
Reproduce code:
---------------
<?
if (isset($_REQUEST['arr1'])) {
print_r($_REQUEST['arr1']); // displays key and value.
print('test1: '.$_REQUEST['arr1'][0]); // error
print_r(array_keys($_REQUEST['arr1'])); // returns one index: '0'
}
?>
<html>
<head>
<title> TestCase </title>
</head>
<body>
<form method=post action="">
test1: <input type="checkbox" name="arr1[0]" value="1" /><br
/>
<input type="submit" />
</form>
</body>
</html>
Expected result:
----------------
test1: 1
Actual result:
--------------
Notice: Undefined offset: 2 in D:\server\www\test\php5\index.phtml on
line 4
test1:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24565&edit=1