From: Michael Wallner Date: Thu, 21 Mar 2013 16:31:20 +0000 (+0100) Subject: fix zend_object_iterator.key with PHP-5.5 X-Git-Tag: v0.1.0~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c566b350f18fe5d2ac5a28e82948514a8798a2b6;p=m6w6%2Fext-pq fix zend_object_iterator.key with PHP-5.5 --- diff --git a/php_pq.c b/php_pq.c index 4608849..40d7c64 100644 --- a/php_pq.c +++ b/php_pq.c @@ -479,6 +479,14 @@ static void php_pqres_iterator_current(zend_object_iterator *i, zval ***data_ptr *data_ptr = &iter->current_val; } +#if PHP_VERSION_ID >= 50500 +static void php_pqres_iterator_key(zend_object_iterator *i, zval *key TSRMLS_DC) +{ + php_pqres_iterator_t *iter = (php_pqres_iterator_t *) i; + + ZVAL_LONG(key, iter->index); +} +#else static int php_pqres_iterator_key(zend_object_iterator *i, char **key_str, uint *key_len, ulong *key_num TSRMLS_DC) { php_pqres_iterator_t *iter = (php_pqres_iterator_t *) i; @@ -487,6 +495,7 @@ static int php_pqres_iterator_key(zend_object_iterator *i, char **key_str, uint return HASH_KEY_IS_LONG; } +#endif static void php_pqres_iterator_invalidate(zend_object_iterator *i TSRMLS_DC) {