Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Craig Duncan
On 28 July 2017 at 12:46, Andrey Andreev wrote: > > This is a long shot, but here's an idea: an OOP API throwing exceptions. > > Would require more work both to implement and use, but it would surely > be less error-prone and there'd be no BC break. > Hi Andrey, Yes that would resolve all BC iss

Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Andrey Andreev
Hi, On Fri, Jul 28, 2017 at 2:39 PM, Jakub Zelenka wrote: > On Fri, Jul 28, 2017 at 12:23 PM, Craig Duncan wrote: > >> Hi Nikita, >> >> Thanks for your input. Would you vote yes for throwing an exception? >> >> > Just to clarify exceptions are no go for 7.x. It would have to be 8.x and > it woul

Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Craig Duncan
On 28 July 2017 at 12:36, Jakub Zelenka wrote: > > Also it would break a big amount of code because in case of converting > errors to exceptions, you start getting a different exception so it would > have to be handled. I would call the whole proposal just a big BC break > (I'm aware that we don'

Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Jakub Zelenka
On Fri, Jul 28, 2017 at 12:23 PM, Craig Duncan wrote: > Hi Nikita, > > Thanks for your input. Would you vote yes for throwing an exception? > > Just to clarify exceptions are no go for 7.x. It would have to be 8.x and it would be a huge BC break so I'm quite confident that this will fail the vote

Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Jakub Zelenka
On Fri, Jul 28, 2017 at 11:59 AM, Craig Duncan wrote: > Hi internals. > > As my initial thread about introducing warnings to the JSON functions was > not immediately flooded with disagreement I took the liberty of creating an > RFC for official discussion. > > The proposal is to have `json_encode

Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Craig Duncan
Hi Nikita, Thanks for your input. Would you vote yes for throwing an exception? On 28 July 2017 at 12:07, Nikita Popov wrote: > > Operations that are expected to fail should never generate warnings. We > should not design functions such that their correct use requires the use of > the error su

Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Andrey Andreev
Hi, On Fri, Jul 28, 2017 at 1:59 PM, Craig Duncan wrote: > Hi internals. > > As my initial thread about introducing warnings to the JSON functions was > not immediately flooded with disagreement I took the liberty of creating an > RFC for official discussion. > > The proposal is to have `json_enc

Re: [PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Nikita Popov
On Fri, Jul 28, 2017 at 12:59 PM, Craig Duncan wrote: > Hi internals. > > As my initial thread about introducing warnings to the JSON functions was > not immediately flooded with disagreement I took the liberty of creating an > RFC for official discussion. > > The proposal is to have `json_encode

[PHP-DEV] [RFC] Raise warnings for json_encode() and json_decode() issues

2017-07-28 Thread Craig Duncan
Hi internals. As my initial thread about introducing warnings to the JSON functions was not immediately flooded with disagreement I took the liberty of creating an RFC for official discussion. The proposal is to have `json_encode()` and `json_decode()` raise warnings whenever a failure occurs, in