Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90362 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55195 invoked from network); 8 Jan 2016 16:26:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2016 16:26:53 -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.172 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.160.172 mail-yk0-f172.google.com Received: from [209.85.160.172] ([209.85.160.172:34010] helo=mail-yk0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/6F-55593-C43EF865 for ; Fri, 08 Jan 2016 11:26:53 -0500 Received: by mail-yk0-f172.google.com with SMTP id a85so289858667ykb.1 for ; Fri, 08 Jan 2016 08:26:52 -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=JNiLbO94WBfpVb3VHzGCZLs6jiw5R9ioq46HmWG49jk=; b=lBLTzzpsq+Yg1ZMIhho+FJ8j/StZs9bpHrcT24Cwd5HDTcIQ+ZDCrFOu7tGn8vUV8P g3Rnqt0K4jk1bM4nu+kPccPsiqkbQo7fLb1GrLI9GR9pRebfH9osZpUS9dgzVf1NZowt p7AYpHyQpvBIQnpL1G4W3VdT5GvZScO2KZt8czD9BD5UCe6nSSY6/o4z0tFFFdmWPdAT KWmVGMMme67uW4qxCkGZ3Y6folOzDJkBAKChrTPnUkofXRNKTlGvYShrGLqY9PFOiHo8 Md5ItIT00BQKNUwDYjQg/6f7Dw3byWAHs5PlHj6tpOjXCN7mYgGufZIn0+HxQbjU/Ntk 4p1w== 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=JNiLbO94WBfpVb3VHzGCZLs6jiw5R9ioq46HmWG49jk=; b=LiWZYsu/ruipWVMMXYNsTjVr28Xz6ZXz1KUfdd0yJVBqwsjYZr5i6JTWPnzacc1AbX DsaUPcSrncTCw+t6hrlWZM1/jvrBASGWF6XTvxle+1+9k460CuSH5kPoJnzFjqB1HPmp YU4aRWmWTbO9/BkSLEFaWFk1nVAAOHM4ui6D9odi2ako/z63yzIg7EhtZKkzVmnkfRTO lGpmvM2JP8QhLH0ZLyzCyMcoWhVm9TriEBzfg/VjOBd1Yaam5z5KXdOs4zTVcJrE0J0H S6p9GWPoAPiR4IBPaIkylknRu9Le6OUUwAWLeT/tWYAvcmY/9XrVYpmyQJFtL9NpYLQO lV7w== X-Gm-Message-State: ALoCoQlgdaWNQ7yEDymKaxbudhITOT615X6Hxm63m+CP/B1ha8GcW1PME5N4CHCqQsXrFRnC/7/AObwqDrIwyfz+Qjoi8j7CoQ== MIME-Version: 1.0 X-Received: by 10.129.29.14 with SMTP id d14mr75333082ywd.182.1452270409772; Fri, 08 Jan 2016 08:26:49 -0800 (PST) Received: by 10.37.83.131 with HTTP; Fri, 8 Jan 2016 08:26:49 -0800 (PST) X-Originating-IP: [2.99.233.57] In-Reply-To: <568FDA4B.60005@gmail.com> References: <568FDA4B.60005@gmail.com> Date: Fri, 8 Jan 2016 16:26:49 +0000 Message-ID: To: Rowan Collins Cc: "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 15:48, Rowan Collins wrote: > > It doesn't do anything to help Stas's example for instance: > > @$counts[$item]++; I think that that code is bogus since the release of PHP 7, which made it trivial to not use the error suppression for this case, while still writing code that doesn't take up multiple lines. $counts[$item] ?? $counts[$item] = 1 ?? $counts[$item]++; Yes - it's a few more characters but it has another benefit: > This is not something which should ever throw an exception, Oh yes, it definitely should: $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. Currently that code fails silently. > I think it would be perfectly reasonable to implement a new file handling API, which behaves like > modern PHP (objects, exceptions, etc) rather than being a thin wrapper for C > > I would also contend that a correctly thrown exception should never be > something you want to just suppress I very much look forward to seeing your proposal for this file handling API, which is both easy to use, and never throws exceptions which people will want to discard. cheers Dan