Marcus Boerger wrote:
  i would like to change foreach a tiny bit. Actually i don't like the
warning when using foreach with null.

The way we use NULL in PHP should result in no warning here. The patch for

Can you elaborate on the "The way we use NULL in PHP" part?

IMPW (In my PHP world) null represents an undefined variable. Trying to iterate over it could be a programming mistake. Like iterating over a scalar value. I normally use foreach ((array)$var as $value) if $var is of "mixed" type which also catches null. But most of the time I'm more comfortable with making sure I provide a real array in all cases and don't rely on magic.

Just my two cents,
- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to