Re: [PHP-DEV] Don't silence fatal errors

2019-02-11 Thread Côme Chilliet
Le dimanche 10 février 2019, 09:34:16 CET Pierre Joye a écrit : > However I think you are right as well in your other replies. While I wrote > @ free code since years and I rarely see some in modern code, removing it > may bring some BC issues that could delay 8 adoptions. Not sure where in this

Re: [PHP-DEV] Don't silence fatal errors

2019-02-09 Thread Pierre Joye
HI Stas, On Sun, Feb 10, 2019, 8:17 AM Stanislav Malyshev Hi! > > > My thought that @ mainly relates to another RFC where errors/warning > > are very inconsistently reported or designed (like forcing one to use > > @). 8 would be a good candidate to clean that up, like the TypeError > > RFC. > >

Re: [PHP-DEV] Don't silence fatal errors

2019-02-09 Thread Stanislav Malyshev
Hi! > My thought that @ mainly relates to another RFC where errors/warning > are very inconsistently reported or designed (like forcing one to use > @). 8 would be a good candidate to clean that up, like the TypeError > RFC. Cleaning up how PHP does errors would be awesome. After 20+ years of

Re: [PHP-DEV] Don't silence fatal errors

2019-02-09 Thread Stanislav Malyshev
Hi! > I am surely missing use cases because I wonder why we need @, at all? Many functions have to deal with "dirty" data - e.g. loading a file that is supposed to be JSON but may be in fact be invalid in any of the hundreds ways. In some cases, we want full diagnostics, in other cases, just

Re: [PHP-DEV] Don't silence fatal errors

2019-02-07 Thread Christian Schneider
Am 07.02.2019 um 14:28 schrieb Rowan Collins : > On 7 February 2019 11:19:46 GMT+00:00, Benjamin Morel > wrote: >> Also, some applications might assume that the directory does not already >> exist, and want to fail if it does. So both use cases must be available in >> the API. mkdir("foo") or

Re: [PHP-DEV] Don't silence fatal errors

2019-02-07 Thread Rowan Collins
On 7 February 2019 11:19:46 GMT+00:00, Benjamin Morel wrote: >Also, some applications might assume that the directory does not >already >exist, and want to fail if it does. So both use cases must be available >in >the API. I absolutely agree, but I also agree that the task here is not "convert

Re: [PHP-DEV] Don't silence fatal errors

2019-02-07 Thread Benjamin Morel
> > Please don't do that either, I don't want to convert > @mkdir("foo"); > to > try { mkdir("foo"); } catch (Exception $e) {} > just to stop my script from exiting if the directory already exists. What you really want is either another function that does not throw an exception

Re: [PHP-DEV] Don't silence fatal errors

2019-02-07 Thread Christian Schneider
Am 07.02.2019 um 10:01 schrieb Benjamin Morel : > IMO, @ can be safely removed the day PHP converts current warnings to > exceptions. Please don't do that either, I don't want to convert @mkdir("foo"); to try { mkdir("foo"); } catch (Exception $e) {} just to stop my script from

Re: [PHP-DEV] Don't silence fatal errors

2019-02-07 Thread Benjamin Morel
> > That is one the cases I meant. Also this is a bug in the user code. I can > imagine doing it on purpose for performance reasons (if the file is > created/deleted by other apps) tho'. > flock is what should be used here. flock doesn't protect from other failures, such as a fread()ing a file

Re: [PHP-DEV] Don't silence fatal errors

2019-02-07 Thread Pierre Joye
On Thu, Feb 7, 2019 at 3:14 PM Christian Schneider wrote: > > Am 07.02.2019 um 02:32 schrieb Pierre Joye : > > On Thu, Feb 7, 2019, 8:07 AM Girgias >> The most common case which comes to mind is to suppress erros while file > >> reading. > >> Because even if you check a file exists it could be

Re: [PHP-DEV] Don't silence fatal errors

2019-02-07 Thread Christian Schneider
Am 07.02.2019 um 02:32 schrieb Pierre Joye : > On Thu, Feb 7, 2019, 8:07 AM Girgias > The most common case which comes to mind is to suppress erros while file >> reading. >> Because even if you check a file exists it could be deleted inbetween the >> check and the >> read command. As you can see

Re: [PHP-DEV] Don't silence fatal errors

2019-02-06 Thread Pierre Joye
On Thu, Feb 7, 2019, 8:07 AM Girgias > The most common case which comes to mind is to suppress erros while file > reading. > Because even if you check a file exists it could be deleted inbetween the > check and the > read command. As you can see this is even written in the documentation [1] > >

Re: [PHP-DEV] Don't silence fatal errors

2019-02-06 Thread Yasuo Ohgaki
On Thu, Feb 7, 2019 at 10:07 AM Girgias wrote: > On Thu, 7 Feb 2019 at 02:03, Pierre Joye wrote: > > > Good morning Nikita, > > > > On Tue, Nov 27, 2018, 4:43 AM Nikita Popov > > > > Hi internals, > > > > > > When the silencing operator @ is used, the intention is generally to > > > silence

Re: [PHP-DEV] Don't silence fatal errors

2019-02-06 Thread Girgias
On Thu, 7 Feb 2019 at 02:03, Pierre Joye wrote: > Good morning Nikita, > > On Tue, Nov 27, 2018, 4:43 AM Nikita Popov > > Hi internals, > > > > When the silencing operator @ is used, the intention is generally to > > silence expected warnings or notices. However, it currently also silences > >

Re: [PHP-DEV] Don't silence fatal errors

2019-02-06 Thread Pierre Joye
Good morning Nikita, On Tue, Nov 27, 2018, 4:43 AM Nikita Popov Hi internals, > > When the silencing operator @ is used, the intention is generally to > silence expected warnings or notices. However, it currently also silences > fatal errors. As fatal errors also abort request execution, the

Re: [PHP-DEV] Don't silence fatal errors

2018-11-29 Thread Michał Brzuchalski
I don't really know if it fits here but some weeks ago I was thinking about annotations with "@" prefix and was considering to propose to handle @ (silence operator) similar way as annotations, like: $value = @ fopen('test.txt','rb+'); might be equivalent to: $value = @SupressError(E_ALL)

Re: [PHP-DEV] Don't silence fatal errors

2018-11-28 Thread Fwentish Aelondes
Breaking BC might be unnecessary if instead of changing the default behavior of @, you add an additional flag to error_reporting that enables the new behavior, something like E_UNSILENCE_FATAL. Then developers would only need to switch a flag in php.ini to get the old behavior back, instead of

Re: [PHP-DEV] Don't silence fatal errors

2018-11-28 Thread Claude Pache
> Le 26 nov. 2018 à 22:42, Nikita Popov a écrit : > > Hi internals, > > When the silencing operator @ is used, the intention is generally to > silence expected warnings or notices. However, it currently also silences > fatal errors. As fatal errors also abort request execution, the result

Re: [PHP-DEV] Don't silence fatal errors

2018-11-28 Thread Agustin Casiva
On Mon, Nov 26, 2018 at 6:43 PM Nikita Popov wrote: > Hi internals, > > When the silencing operator @ is used, the intention is generally to > silence expected warnings or notices. However, it currently also silences > fatal errors. As fatal errors also abort request execution, the result will

Re: [PHP-DEV] Don't silence fatal errors

2018-11-27 Thread Thomas Hruska
On 11/27/2018 8:26 AM, Nikita Popov wrote: On Tue, Nov 27, 2018 at 2:20 PM Thomas Hruska wrote: On 11/26/2018 2:42 PM, Nikita Popov wrote: Hi internals, When the silencing operator @ is used, the intention is generally to silence expected warnings or notices. However, it currently also

Re: [PHP-DEV] Don't silence fatal errors

2018-11-27 Thread Nikita Popov
On Tue, Nov 27, 2018 at 2:20 PM Thomas Hruska wrote: > On 11/26/2018 2:42 PM, Nikita Popov wrote: > > Hi internals, > > > > When the silencing operator @ is used, the intention is generally to > > silence expected warnings or notices. However, it currently also silences > > fatal errors. As

Re: [PHP-DEV] Don't silence fatal errors

2018-11-27 Thread Thomas Hruska
On 11/26/2018 2:42 PM, Nikita Popov wrote: Hi internals, When the silencing operator @ is used, the intention is generally to silence expected warnings or notices. However, it currently also silences fatal errors. As fatal errors also abort request execution, the result will often be a hard

[PHP-DEV] Don't silence fatal errors

2018-11-26 Thread Nikita Popov
Hi internals, When the silencing operator @ is used, the intention is generally to silence expected warnings or notices. However, it currently also silences fatal errors. As fatal errors also abort request execution, the result will often be a hard to debug white screen of death. The most