Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90389 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2748 invoked from network); 8 Jan 2016 18:45:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2016 18:45:40 -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.174 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.174 mail-pf0-f174.google.com Received: from [209.85.192.174] ([209.85.192.174:35139] helo=mail-pf0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/69-55593-4D300965 for ; Fri, 08 Jan 2016 13:45:40 -0500 Received: by mail-pf0-f174.google.com with SMTP id 65so13244061pff.2 for ; Fri, 08 Jan 2016 10:45:39 -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=SVsfzd+bNLm1nIxVeHT3xL1AmzEL8P+i4b1sj1ct4Ww=; b=tUgLU2nSMe9hSerOrRF09y9ISGo7ZmftWO8Uy/Zy57mDnBkv0Jc0+cUbhp1oOO/l+g oZHNKlL0t2+meKWek3kLPbHri9FH71WH2SNRTUGyh/2N2RuFsdLfDEZtbWZv28eLsOsE WODMD4ruqup5QoWsaEAVlsKPVQr7RslVthbn48TbrTsQusiEs9ee7YCKxDd+A4GlMBmr VyRiaL9Jilx0gdt4tuH5ziACOSxm0/Bhmb/wWd9WL1IqFDbPIg3O9eUjY9dv/vl09qrd RkRXunhZi+7PgxTTwxh/Sby5drPrZLsYGhSF+2pZebPnrfH6wqmkhQ3ne/uQa0b+0ZaV gsQg== X-Received: by 10.98.7.156 with SMTP id 28mr6458646pfh.49.1452278736532; Fri, 08 Jan 2016 10:45:36 -0800 (PST) Received: from stas-air.corp.wikimedia.org (tan1.corp.wikimedia.org. [198.73.209.1]) by smtp.gmail.com with ESMTPSA id x80sm6365057pfi.72.2016.01.08.10.45.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jan 2016 10:45:35 -0800 (PST) To: Ryan Pallas References: <568FDA4B.60005@gmail.com> <568FFE13.2010304@gmail.com> Cc: Dan Ackroyd , Rowan Collins , "internals@lists.php.net" Message-ID: <569003CE.4030104@gmail.com> Date: Fri, 8 Jan 2016 10:45:34 -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! > when doing something defined as invalid will be hard. If you don't want > to count garbage, then you should use if() > > if (!is_garbage($key)) @$count[$key]++; And if you want to check, just do: if (is_garbage($key)) { throw Exception("Garbage!"); } Except in this case you know what's going on and when the exception is thrown and can do what you like, instead of your code just blowing up randomly with no warning. Or, alternatively, having to check for an exception each time you do an array access. -- Stas Malyshev smalyshev@gmail.com