Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99867 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17050 invoked from network); 13 Jul 2017 07:01:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2017 07:01:38 -0000 Authentication-Results: pb1.pair.com header.from=michal.brzuchalski@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=michal.brzuchalski@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.174 as permitted sender) X-PHP-List-Original-Sender: michal.brzuchalski@gmail.com X-Host-Fingerprint: 209.85.128.174 mail-wr0-f174.google.com Received: from [209.85.128.174] ([209.85.128.174:36560] helo=mail-wr0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/BB-01782-0DA17695 for ; Thu, 13 Jul 2017 03:01:36 -0400 Received: by mail-wr0-f174.google.com with SMTP id c11so48048841wrc.3 for ; Thu, 13 Jul 2017 00:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7Iv2p81Vohkyr73wiq6roaKfQ+OnAFaCqmVbvbt/5OM=; b=sJMlcOe4m/JCMl+PrK4MGHo2gpDYXd2t4/l1ACNucZ8lGQ3yp8lwfFR1TxYqUJqee2 bIdpeD2oddpPQCCK60rkl1XpdAHxss5sKuZkimx1y0Jxx8KLkZAER3MvG2s3Xnlszm7o fk86lnveKoBGoRPOPaxEklDWV4H8quHgdbhIdre/sTG5cDtdPsA8pqTIIo50zEV9fySj TGRJGFeGY7TCNtsksUsv/+aXi9aXzXMlzRK2uxJ+eQyd16RZHRzwzF8zmzhHUDOKk2BW kiY/3Nnn2r3PuVklIWdaIHcYqqreTwZUzIM+/JfIYevGZmmhTbcyBUqjIDpkJDcoTtB2 YfoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7Iv2p81Vohkyr73wiq6roaKfQ+OnAFaCqmVbvbt/5OM=; b=cLJuOpj0XrgrmTuuB5qHpTN5X1N+9o5OC6brI8jlyVbYJAQj66kqrq2pcgDXucF3KE v77Q/0f5fSa0/2Hd9ZZlgSRa4BCMimpB6VDFn4cS5AnIoEHaNfLYKpWl8y8jWMjBTeKh e/mwiyktL1jNwPZCqNvtcSV++SfwwW5jnsBowa8Z6IIIC+dnZHelarj0K/pqJTZBURXE q8RZdiZuKb+oWlo4gYsR8+skojVQed4TIOMy21P8REcGjnIYRG8yhykArN8VtbQM9CEn sLDUKAmFxt/+r/lMBa+Xbjx3gNwI0tsfe8haWbvMEhfqoGre2I+xkl/b6fI7u/CWQdS2 eksw== X-Gm-Message-State: AIVw1100TCh8b9bru4Talbmi49iWv7OxgtZbhJCpwuyrSaVDTtJNSEsE UZ9A78K0UnYMGUVFkKQyzlqP+3tBXQ== X-Received: by 10.223.166.148 with SMTP id t20mr620692wrc.52.1499929293826; Thu, 13 Jul 2017 00:01:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.134.13 with HTTP; Thu, 13 Jul 2017 00:01:32 -0700 (PDT) In-Reply-To: References: Date: Thu, 13 Jul 2017 09:01:32 +0200 Message-ID: To: Niklas Keller Cc: Mark Shust , Rowan Collins , PHP Internals List , Aidan Woods Content-Type: multipart/alternative; boundary="001a1146d954bf306705542d804f" Subject: Re: [PHP-DEV] array coalesce operator concept From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --001a1146d954bf306705542d804f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2017-07-12 22:14 GMT+02:00 Niklas Keller : > 2017-07-12 17:26 GMT+02:00 Micha=C5=82 Brzuchalski < > michal.brzuchalski@gmail.com>: > >> 12.07.2017 15:35 "Mark Shust" napisa=C5=82(a): >> > >> > Hi Aidan, >> > >> > I think you are correct on all points. The initial emit is just a >> warning, >> > so I think a suppressor will work just fine, since it does just pass >> over >> > the foreach if a traversable isn't passed in. >> > >> > I could see this being helpful as it makes wrapping an if block around= a >> > foreach not needed anymore (and in turn indenting the foreach another >> > level), replacing it with just a single character. I also think for >> those >> > that use linting tools and flag error suppressions, that an @as >> definition >> > could be easily ignored from such a linter. I develop with warnings on= , >> and >> > see error suppressions as a sort of code smell, however I think the @a= s >> > definition could be really useful. >> >> IMHO the whole error supression and its operator should be deprecated an= d >> removed from language. Supressing errors is just hiding problems because >> someone didn't want to solve it. Supressing errors makes debuging very >> hard >> and leads to frustration. > > > You have to update a whole lot of APIs before you can do that. There are > many things where it's better to ignore the warning and check the return > value and throw an exception if something is wrong. > > Regards, Niklas > > Hi Niklas, could you name few of them? My ideal vision is catching thrown exceptions instead of suppressing errors= . BTW it would unlock '@' for future features like use for annotations/attributes. Regards, -- Micha=C5=82 Brzuchalski --001a1146d954bf306705542d804f--