Skip to content

Commit 803117f

Browse files
authored
PHPC-2627: Use appropriate return type for zend_object_iterator_funcs.valid (#1890)
1 parent 1749121 commit 803117f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/BSON/Iterator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static void php_phongo_iterator_it_dtor(zend_object_iterator* iter)
303303
zval_ptr_dtor(&iter->data);
304304
}
305305

306-
static int php_phongo_iterator_it_valid(zend_object_iterator* iter)
306+
static PHONGO_ITERATOR_VALID_RESULT php_phongo_iterator_it_valid(zend_object_iterator* iter)
307307
{
308308
php_phongo_iterator_t* intern = Z_ITERATOR_OBJ_P(&iter->data);
309309

src/phongo_compat.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,11 @@ const char* zend_get_object_type_case(const zend_class_entry* ce, zend_bool uppe
218218
#define zend_get_object_type_uc(ce) zend_get_object_type_case((ce), true)
219219
#endif /* PHP_VERSION_ID < 80200 */
220220

221+
/* zend_object_iterator_funcs.valid return type changed to zend_result in PHP 8.4 */
222+
#if PHP_VERSION_ID < 80400
223+
#define PHONGO_ITERATOR_VALID_RESULT int
224+
#else
225+
#define PHONGO_ITERATOR_VALID_RESULT zend_result
226+
#endif
227+
221228
#endif /* PHONGO_COMPAT_H */

0 commit comments

Comments
 (0)