ID: 24565 Comment by: tingle at virtuanews dot co dot uk Reported By: nightcat at poczta dot onet dot pl Status: Open Bug Type: Zend Engine 2 problem Operating System: Windows XP PHP Version: 5CVS-2003-07-09 (dev) New Comment:
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 Previous Comments: ------------------------------------------------------------------------ [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