> PHP already exhibits the skipping behaviour (it only emits a warning
> for the wrong type used in `foreach`, skips the loop, and then
> continues with remaining code).
Yes, a warning is not an error. If someone dont care about warnings from
error prone code, set the error_reporting accordingly to hide the messages.
With the following code you do not even get a warning about a undefined
variable.
foreach($foobar ?? [] as $value) {
var_dump($value);
}
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php