Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90088 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70757 invoked from network); 5 Jan 2016 12:28:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2016 12:28:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=grzegorz129@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=grzegorz129@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.44 as permitted sender) X-PHP-List-Original-Sender: grzegorz129@gmail.com X-Host-Fingerprint: 209.85.192.44 mail-qg0-f44.google.com Received: from [209.85.192.44] ([209.85.192.44:36789] helo=mail-qg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/FC-24214-FD6BB865 for ; Tue, 05 Jan 2016 07:28:15 -0500 Received: by mail-qg0-f44.google.com with SMTP id e32so186253049qgf.3 for ; Tue, 05 Jan 2016 04:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=rsQ/awtYu+rFX7GRs1/afY1xUW07aeKoLPDxj++1pVI=; b=E3Fbum7m9kGRpHEbY8t/Gm+Ed1jo1FqDA/iMqCBfJ7vbnhyIatQYSP8afhoNDGd6Jl AufeNRYyml4m/uBdRvxa0hK6Lwmjsf5XtZS3SgYIWDrbR9EFp9AShcCuKyseObDB9l9F N2twNbr5CKsn1620ZrYLAqxwLXg7uNyaEdlr7IETd1XFkiRP4h/Kz9NEUKFxCIY9T153 xCSALj+NGhEuLslceuDjXJJiYve458xeL0hoL58Zdh3pOceXUTe6siezV6kkscxr2Mkg w44KMFihI5HxpRIE+2AoP8VQCkqyt+H6npGuR04YOxNIF5CUISw/YDNLN7aLVfP694jN AR8A== X-Received: by 10.140.249.2 with SMTP id u2mr128121575qhc.53.1451996892753; Tue, 05 Jan 2016 04:28:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.55.182.135 with HTTP; Tue, 5 Jan 2016 04:27:53 -0800 (PST) In-Reply-To: References: Date: Tue, 5 Jan 2016 13:27:53 +0100 Message-ID: To: Zeev Suraski Cc: Derick Rethans , Michael Heap , Sara Golemon , Junade Ali , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Deprecation of the Error Control Operator (@ symbol) From: grzegorz129@gmail.com (Grzegorz Zdanowski) >> -----Original Message----- >> From: Derick Rethans [mailto:derick@php.net] >> Sent: Tuesday, January 05, 2016 12:57 PM >> To: Michael Heap >> Cc: Sara Golemon; Junade Ali; PHP internals >> Subject: Re: [PHP-DEV] Deprecation of the Error Control Operator (@ >> symbol) >> >> On Tue, 5 Jan 2016, Michael Heap wrote: >> >> > >> > On Tue, Jan 5, 2016 at 5:45 AM, Sara Golemon wrote: >> > >> > > On Thu, Dec 31, 2015 at 6:52 AM, Junade Ali wrote: >> > > > I am looking to submit an RFC in order to remove the error >> > > > suppression operator in PHP, namely the @ symbol. >> > > > >> > > Forwarding a suggestion twitter/@Beryllium9: >> > > >> > > How about a global "disable error suppression" setting? That way a >> > > project lead could enforce it for their codebase (and guarantee that >> > > devs "aren't lazy"), but PHP doesn't lose its pragmatism? >> >> > Sounds like the xdebug.scream or the Scream PECL extension ( >> > https://pecl.php.net/package/scream) to me. >> > >> > +1 for baking this functionality into core >> >> That's going to mean an INI setting.. that hosters could abuse. Having > an INI >> setting like this as part of core is IMO not a great idea. > > I agree. Perhaps through a declare() statement instead? We could easily > make it file-based, so that the declare() statement only affects the local > file, or we could make it global for the entire request. > > Zeev > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > I can't agree more - it's a pain such thing as @ exists. However we have a bigger issue here - a lot PHP function returns false AND raises E_WARNING. fopen, fwrite, fread, stream_select.... a lot of them which I use daily. Before deprecating @ operator I think we should make a RFC which cover unified setting to convert all E_* to exceptions (like PhpWarningException). I know it's just a temporary solution, because exception should be more specific, but it's a huge amount of work to replace all errors and warnings with proper exceptions. Of course it's possible to convert all errors and warnings to exceptions using set_error_handler(), but it will be next boilerplate code for all apps. -- Cheers, Grzegorz Zdanowski.