Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90385 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96874 invoked from network); 8 Jan 2016 18:36:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2016 18:36:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.160.180 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.160.180 mail-yk0-f180.google.com Received: from [209.85.160.180] ([209.85.160.180:36127] helo=mail-yk0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/28-55593-AC100965 for ; Fri, 08 Jan 2016 13:36:58 -0500 Received: by mail-yk0-f180.google.com with SMTP id v14so278263965ykd.3 for ; Fri, 08 Jan 2016 10:36:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Ngxb2CQo5JTdnYi6luuu3JiQELVsiqAckrUZWBE1iOE=; b=fdO16ZOWEQGrs3BSJGDcQ8vaNNvATsgbpV6OcMHJdWxtvo7/+zziT/fXhmZ/vzgaJA s6X3hWPbRspy2245041B5P50GXHmsBhnhbHXEgvd/AU90vHzuPm4TtX5iVEx25B0FYRe fYGZ/wEnF6icB2MxW0t6X26rEv/ZYOdrSu2C64PTf5szCX6Ud4dP1X/NQ72CLt73N2Bi ylMul7XGQEAHmjfDcr/Eso8qa3VpJk0qRQQvIAPLsnBYVbohf4ufSsEB8zFRW8VdubeO OLbZgzzIqVAjpJSyMWItXb7huwQG/APOwQnf9hc8CklzyBhfvntHvsDhjsuoYxTag+SP qpvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Ngxb2CQo5JTdnYi6luuu3JiQELVsiqAckrUZWBE1iOE=; b=eQ+43+aXzEHSRFvcTx6NpDScPGkNLf+LAtOb6wyCTuXQryndrobTzzd2I3O3G/EAyW m4ggsZPEPViVeHZk5nQdxvBxvewMBH493hoUqfG3G4i2kDkx22aLHMAsHJHs3LjeDCS+ Zs63jad7xZiPpPnsL+O85R4B2K4sphve90Ude3ycZmBRlmXQ87DTMzDLYwvbKHKMxFp5 eKfz+cfPAQ5rf0N7o2IWpcFrUFh4Qs5FPVOPz68kDV3plqtymybnEAhHhMw5B3GY51Um pEj2mKfLhMhysO5MQd0A+VDzxDz1py5yv9IXCHxrDSmnvoXYrZNjWqsSDpQqnesKfsF5 blDw== X-Gm-Message-State: ALoCoQkAleVCGy3QVd63dhu2Cns2ncg2oDdvmX/yorbwW4hBNipJyA7IJGph4BGYNAx09KnTCzd3poxVjpJ1IPmp5hnFy6jXeQ== MIME-Version: 1.0 X-Received: by 10.129.27.13 with SMTP id b13mr80491803ywb.133.1452278215929; Fri, 08 Jan 2016 10:36:55 -0800 (PST) Received: by 10.37.83.131 with HTTP; Fri, 8 Jan 2016 10:36:55 -0800 (PST) X-Originating-IP: [2.99.233.57] In-Reply-To: <568FFE13.2010304@gmail.com> References: <568FDA4B.60005@gmail.com> <568FFE13.2010304@gmail.com> Date: Fri, 8 Jan 2016 18:36:55 +0000 Message-ID: To: Stanislav Malyshev Cc: Rowan Collins , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Deprecation of the Error Control Operator (@ symbol) From: danack@basereality.com (Dan Ackroyd) On 8 January 2016 at 18:21, Stanislav Malyshev wrote: > Hi! > This looks completely unreadable and I do not think it works: > https://3v4l.org/PlAHH > Seems to leave $counts as 1 always. But even if it didn't, I would never > pass that on code review - it is very hard to understand what's going on > and it is incredibly easy to break it. Apologies, it should be: $counts[$item] = ($counts[$item] ?? 0) + 1; Which both works, and to me, is more readable than the @ version, as it doesn't rely on the person reading it knowing what the magic behaviour PHP has when using an array that has not been set. > it is very hard to understand what's going on > and it is incredibly easy to break it. You've had many years getting used to the current way of doing things. At some point you should try to get used to new features. > And that is exactly what I want it to do. Sometimes silent failure is > *good*, I don't want to know about every little thing that could go > wrong, I just want what's right to be done. > Of course, your intent may be the opposite - but that's exactly the > point, there's more than one use case. Yes, yes, totally agreed. Sometimes you just want to be able to tell the computer, "I know what I'm doing, don't nag" which is why the @ is great, even though what it does might still use some improvement. cheers Dan