PHPC-216: PHP5.5 change the prototype of get_current_key leading to

very strange and hard to track down segfaults
This commit is contained in:
Hannes Magnusson
2015-03-30 17:03:29 -07:00
parent 2f9b1dc16b
commit eb3aa9f939
+10
View File
@@ -1447,10 +1447,20 @@ static int phongo_result_iterator_valid(zend_object_iterator *iter TSRMLS_DC) /*
return FAILURE;
} /* }}} */
#if PHP_VERSION_ID < 50500
static int phongo_result_iterator_get_current_key(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) /* {{{ */
{
phongo_cursor_it *cursorit = (phongo_cursor_it *)iter;
*int_key = (ulong) cursorit->current;
return HASH_KEY_IS_LONG;
} /* }}} */
#else
static void phongo_result_iterator_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /* {{{ */
{
ZVAL_LONG(key, ((phongo_cursor_it *)iter)->current);
} /* }}} */
#endif
static void phongo_result_iterator_get_current_data(zend_object_iterator *iter, zval ***data TSRMLS_DC) /* {{{ */
{