Re: About SUCCESS/FAILURE
| From: | Julien Pauli | Date: | Mon, 05 Jan 2015 10:05:26 +0000 |
| Subject: | Re: About SUCCESS/FAILURE | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80171@lists.php.net to get a copy of this message | ||
On Sat, Dec 27, 2014 at 4:45 AM, Pierre Joye <pierre.php@gmail.com> wrote:
> On Dec 26, 2014 7:42 PM, "Xinchen Hui" <laruence@php.net> wrote:
> >
> > Hey:
> >
> > On Fri, Dec 26, 2014 at 7:54 PM, Andrea Faulds <ajf@ajf.me> wrote:
> > >
> > >> On 26 Dec 2014, at 05:57, Levi Morrison <levim@php.net> wrote:
> > >>
> > >>> On Thu, Dec 25, 2014 at 2:33 PM, Michael Wallner <mike@php.net>
> wrote:
> > >>> There's already ZEND_RESULT_CODE, or did I miss anything?
> > >>
> > >> According to lxr.php.net, this symbol ZEND_RESULT_CODE is not
> > >> referenced in any place except its definition. We can begin using it
> > >> if we like, or even rename it. Theoretically renaming it may break
> > >> extensions; none that I could find reference it, though.
> > >
> > > Hey Levi,
> > >
> > > I think we should just rename it, it's a little too long. zend_status
> or ZEND_STATUS would be fine with me, preferably the former since we tend
> to use lowercase type names. Another possibility might be zend_result.
> > >
> > zend_status +1
> > > If you folks like, I could go ahead and write a patch for master to
> rename it and use it in a bunch of places.
> >
> > great, thanks... please only added it to these functions who already
> > use success/failure, don't change others :)
>
> We could just do the ones returning integer as status as a 2nd step, or in
> the same commit. The latter would be cleaner.
>
I'm happy about Laruence's idea of unity and consistency.
Having some APIS returns SUCCESS/FAILURE and others return 1/0 is a mess.
+1 for consistency
An enum looks like a good choice.
Julien.P