Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99858 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75626 invoked from network); 12 Jul 2017 16:16:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jul 2017 16:16:37 -0000 X-Host-Fingerprint: 62.180.109.77 unknown Received: from [62.180.109.77] ([62.180.109.77:23679] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/A7-01782-26B46695 for ; Wed, 12 Jul 2017 12:16:34 -0400 Message-ID: To: internals@lists.php.net References: <3e8e0194-c594-2c3f-4c55-9b21ddfee768@hoa-project.net> Date: Wed, 12 Jul 2017 18:16:29 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <3e8e0194-c594-2c3f-4c55-9b21ddfee768@hoa-project.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 62.180.109.77 Subject: Re: [PHP-DEV] array coalesce operator concept From: gmblar@gmail.com (Andreas Treichel) > 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); }