Re: About SUCCESS/FAILURE

From: Date: Wed, 24 Dec 2014 08:53:39 +0000
Subject: Re: About SUCCESS/FAILURE
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-79914@lists.php.net to get a copy of this message
On Wed, Dec 24, 2014 at 3:57 PM, Pierre Joye <pierre.php@gmail.com> wrote: > > On Dec 24, 2014 2:38 PM, "Stanislav Malyshev" <smalyshev@gmail.com> wrote: >> >> Hi! >> >> > But: return 0 and return FAILURE... which is simpler? >> >> It's equally simple to write, but FAILURE of course is way simpler to >> understand when read. > > I totally agree. > > I do not care much about the value of failure or success but I am tired to > have to read the code to see if it is 0, 1, or -1 on failure. > > The kind of uniformization I would like to see for the php internals APIs. > > About the argument for the lack of info in function signature: > > A simple typedef will solve it, for the good: > > status php_foo(); > > Or something along this line. > > Yes, it will mean yet another large set of changes for ext developers. But > at this point, it may be a good time to do it. hmm, okey so, make the functions which use SUCCESS/FAILURE return php_success type? and maybe also typedef php_success php_status? thanks thanks > > Cheers, > Pierre -- Xinchen Hui @Laruence http://www.laruence.com/

« previous php.internals (#79914) next »