Re: cvs: php4 /ext/standard array.c basic_functions.c php_array.h
| From: | Jon Parise | Date: | Thu, 12 Sep 2002 03:30:17 +0000 |
| Subject: | Re: cvs: php4 /ext/standard array.c basic_functions.c php_array.h | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-88231@lists.php.net to get a copy of this message | ||
On Wed, Sep 11, 2002 at 06:13:48PM -0000, Andrey Hristov wrote:
> andrey Wed Sep 11 14:13:48 2002 EDT
>
> Modified files:
> /php4/ext/standard array.c basic_functions.c php_array.h
> Log:
> New function added : array_diff_assoc() . Like array_diff() but does
> additional checks on key values. Test script will be added too.
[snip]
> +PHP_FUNCTION(array_diff)
> +{
> + php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0 TSRMLS_CC);
> +}
[snip]
> +PHP_FUNCTION(array_diff_assoc)
> +{
> + php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1 TSRMLS_CC);
> +}
Looks good overall, but I would suggest using #define'd values for the
'behavior' parameter instead of explicitly passing 0 and 1 as magic
numbers.
e.g.:
#define DIFF_NORMAL 0
#define DIFF_ASSOC 1
php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, DIFF_ASSOC TSRMLS_CC);
You get the idea. =)
--
Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)