Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91968 invoked from network); 8 Jan 2016 18:21:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2016 18:21:12 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.172 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.172 mail-pf0-f172.google.com Received: from [209.85.192.172] ([209.85.192.172:34796] helo=mail-pf0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/17-55593-71EFF865 for ; Fri, 08 Jan 2016 13:21:11 -0500 Received: by mail-pf0-f172.google.com with SMTP id q63so13324453pfb.1 for ; Fri, 08 Jan 2016 10:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=5wwVHrwh2KgHzqiYdvj+gjdVnb8ghZ2qK/vymEYyDFo=; b=tJhRqAQDL1Pb9NK7BxkC7hi0egjK0LfOyadbHOQYNAcXE/dodZltjp/bFLmm6VDgpI V10PyMc9ADyt1Rw4fJKyZkjIh3AGXWcW5ZwV5dA6B1n19qiNcOOzy5ezuH7/a8OyazPM sMs86FJ/BhGjy6Kr0rgGEbgsparOfVYLsZnb8RLK9qkRxxQeieLXweCGRT1jazzhjlp4 uR3uDDQ9M6YmQnqnWu8B1oncDnl946t3POppD3OymnyPYLMoRN0U0H/TGLVxOHRUu749 zxJziMmiUC2TKjsrrFf+6gpu/skLUn+gXlAazHEAhGU9E6cKwXhm5Z+TqVxCFU9PtLc0 qm+A== X-Received: by 10.98.73.29 with SMTP id w29mr4043642pfa.106.1452277268754; Fri, 08 Jan 2016 10:21:08 -0800 (PST) Received: from stas-air.corp.wikimedia.org (tan1.corp.wikimedia.org. [198.73.209.1]) by smtp.gmail.com with ESMTPSA id p20sm6284455pfi.86.2016.01.08.10.21.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jan 2016 10:21:08 -0800 (PST) To: Dan Ackroyd , Rowan Collins References: <568FDA4B.60005@gmail.com> Cc: "internals@lists.php.net" X-Enigmail-Draft-Status: N1110 Message-ID: <568FFE13.2010304@gmail.com> Date: Fri, 8 Jan 2016 10:21:07 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Deprecation of the Error Control Operator (@ symbol) From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > $counts[$item] ?? $counts[$item] = 1 ?? $counts[$item]++; 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. Doing such stuff is definitely not the solution, if you hate @, then if() is way better, at least it's clear. > $item = new StdClass; > @$counts[$item] = "This is a bad use of error suppression."; > > There is no insertion, because arrays don't support object keys. The > operation completly failed and so there should be an exception. No, there should not. If somebody tries to count garbage, I just don't want to count it. I don't care about it, it's garbage. > Currently that code fails silently. 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. -- Stas Malyshev smalyshev@gmail.com