From 22d3eb3117b1b5c484152c9fec5a74b0e95024ea Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 8 Apr 2014 23:24:52 +0200 Subject: Add zend_hash_splice This implements the original functionality of php_splice, but as an in-place operation, thus avoiding copying the HT. This is much faster (~10x) if the splice removes a small portion of the array and doesn't insert many elements. --- ext/standard/php_array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/standard/php_array.h') diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index c4389dd92a..deddeb4871 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -103,7 +103,7 @@ PHP_FUNCTION(array_key_exists); PHP_FUNCTION(array_chunk); PHP_FUNCTION(array_combine); -PHPAPI HashTable* php_splice(HashTable *, int, int, zval ***, int, HashTable **); +PHPAPI void php_splice(HashTable *ht, zend_uint offset, zend_uint length, zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC); PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS_DC); PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src TSRMLS_DC); PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC); -- cgit v1.2.1