> On 24 Dec 2014, at 03:25, Xinchen Hui <larue...@php.net> wrote:
> 
> Hey:
> 
>   We use SUCCESS/FAILURE as return value  in some APIs, but use
> 0/1(false/true) in others.
> 
>   I'd like to remove SUCCESS/FAILURE at all, use 0/1 instead..
> 
>   what do you think?
> 
> thanks

Hi,

Honestly, I don’t think SUCCESS and FAILURE are bad, they make it explicit that 
some operation is taking place. But using int as the return type seems odd, 
maybe we could add some zend_ type for this, maybe an alias of zend_bool?

Similarly, though zend_uchar seems to be what’s used most of the time to store 
the return value of Z_TYPE(), maybe something like zend_type might be good.

In fact, this is exactly what enums do, maybe we should use one:

typedef enum _zend_success {
    FAILURE = 0,
    SUCCESS = 1
} zend_success;

Thanks.
--
Andrea Faulds
http://ajf.me/





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

Reply via email to