Bug #16684 Updated: parse error on foreach given array as $_REQUEST['list']

From: Date: Thu, 18 Apr 2002 16:45:55 +0000
Subject: Bug #16684 Updated: parse error on foreach given array as $_REQUEST['list']
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-5319@lists.php.net to get a copy of this message
ID: 16684 Updated by: bob@mroczka.com Reported By: bob@mroczka.com -Status: Bogus +Status: Open Bug Type: Arrays related Operating System: linux PHP Version: 4.2.0 New Comment: This is not a support question. I know there many ways to iterate over an array. I just wanted to alert you to the fact there is a problem with the foreach construct in its handling of multi-dimensional arrays. Previous Comments: ------------------------------------------------------------------------ [2002-04-18 12:37:30] sander@php.net The bug system is not the appropriate forum for asking support questions. For a list of a range of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php ------------------------------------------------------------------------ [2002-04-18 12:17:59] bob@mroczka.com i would like to iterate over the array named $_REQUEST['list'] like this: foreach($_REQUEST['list'] as $user) { if (strlen($user")>$max) die("too long"); } error_log("gettype gives: ". gettype($_REQUEST['list']),0); when php attempts to run this code I get this parse error in my apache log: PHP Parse error: parse error, unexpected '\"' in /var/www/htdocs/tmp.php on line 698 The message I write to the log about the type confirms that the variable is an array. I am currently using 4.2.0rc4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16684&edit=1

« previous php.bugs (#5319) next »