>> -----Original Message-----
>> From: Derick Rethans [mailto:der...@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 <poll...@php.net> wrote:
>> >
>> > > On Thu, Dec 31, 2015 at 6:52 AM, Junade Ali <m...@junade.com> 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.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to