[PHP] Re: foreach fails on unitialized array?

2002-08-30 Thread Richard Lynch
When I use foreach on a uninitialized array I get the following warning: Warning: Invalid argument supplied for foreach() in /www/htdocs/jc/cart/add_item.php on line 21 I would expect foreach to treat an unitialized variable as an empty array and hence do nothing. Is this the expected

[PHP] Re: foreach fails on unitialized array?

2002-08-30 Thread Richard Lynch
From: "Richard Lynch" [EMAIL PROTECTED] If you absolute *MUST* refuse to initialize the array (BAD IDEA!) You would be *MUCH* better off listening to those warnings and fixing your code. I totally agree with. I was just peeved that PHP would handle unitiliazed strings without a warning (a