Hi Levi,

On Tue, Dec 6, 2016 at 7:50 AM, Levi Morrison <le...@php.net> wrote:
> I apologize for the late review of your RFC. This RFC has a few issues
> which I think need to be fixed (yes, this means I am asking you to
> pull it out of voting phase).
>
> It does not specify how to indicate an encoding or decoding error. As
> these are unexpected and userland code may throw exceptions anyway I
> am fine with an exception being used here (as opposed to returning
> null). However in its current form it is incomplete.
>
> The RFC says this about the return value of the encoding function:
>
>     Returning anything other than string raises E_RECOVERABLE_ERROR
>
> And similarly this for the decoding function:
>
>    Returning anything other than array raises E_RECOVERABLE_ERROR
>
> These are not consistent with return type checking. This *must* reuse
> the error checking that is already in-place and not provide something
> new to accomplish the same thing.

What do you mean by inconsistent?

Encode function must return "string" for successful operation.
Decode function must return "array" for successful operation.

Anything other than these return types are invalid and should fail
always. Making "false" error condition and treat other invalid types
differently? This does not make sense.

What do you think missing here?
What is your proposal?

Thank you.

--
Yasuo Ohgaki
yohg...@ohgaki.net

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

Reply via email to