Re: Re: [PHP4BETA] cvs: /php4/ext/standard array.c
| From: | Sterling Hughes | Date: | Wed, 29 Mar 2000 16:36:30 +0000 |
| Subject: | Re: Re: [PHP4BETA] cvs: /php4/ext/standard array.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12808@lists.php.net to get a copy of this message | ||
> On Wed, 29 Mar 2000, Thies C . Arntzen wrote:
> > hmm - that's intresting - it used to be false... (i was just
> > going to say: "hey andrei, you're wrong" - but you're right:)
>
> I think that _every_ function with return type 'void' should actually
> return NULL.
I agree that every function with return type 'void' should return NULL either on success
or on failure from non-user errors, however, I think when the user does something wrong (in the case
of array.c most of the return values changed are for invalid types), the program should whine and
bitch in every possible way, including returning false.
As far as array.c is concerned many of the functions that are prototyped as void (such as rsort or
sort or any of the sort functions actually) return true on success, therefore shouldn't it make
sense that they return false on failure?
If we decide to change the return value back to NULL on failure, perhaps we should stop the
functions from returning true as well.
Sterling