diff options
author | Sherif Ramadan <googleguy@php.net> | 2013-10-30 09:36:19 -0400 |
---|---|---|
committer | Sherif Ramadan <googleguy@php.net> | 2013-10-30 09:36:19 -0400 |
commit | 98c9e56ef0be89953729754bd9949e14c7248c15 (patch) | |
tree | 53f3c02afd4338b05d7d03f83cdb69953e2b07d5 /ext/standard/php_array.h | |
parent | 4218e89f8df4ca3897e3aad595e0c2c9cf4c3aca (diff) | |
parent | 75ba75e2055d670e204e6361732995ba27b05896 (diff) | |
download | php-git-98c9e56ef0be89953729754bd9949e14c7248c15.tar.gz |
Merge branch 'pull-request/287'
Add ability to use array keys with array_filter().
This adds a third (optional) argument to array_filter() that will determine
what gets passed to the callback, the array key, value or both.
The third argument can be one of two constants: ARRAY_FILTER_USE_BOTH or,
ARRAY_FILTER_USE_KEY.
Diffstat (limited to 'ext/standard/php_array.h')
-rw-r--r-- | ext/standard/php_array.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index 1cf2779071..ef43cddfcc 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -117,6 +117,9 @@ PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC); #define PHP_SORT_NATURAL 6 #define PHP_SORT_FLAG_CASE 8 +#define ARRAY_FILTER_USE_BOTH 1 +#define ARRAY_FILTER_USE_KEY 2 + ZEND_BEGIN_MODULE_GLOBALS(array) int *multisort_flags[2]; int (*compare_func)(zval *result, zval *op1, zval *op2 TSRMLS_DC); |