@@ -283,6 +283,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 1)
283283 ZEND_ARG_INFO (0 , value )
284284ZEND_END_ARG_INFO ()
285285
286+ #if PHP_MAJOR_VERSION >= 8
287+ ZEND_BEGIN_ARG_INFO_EX (arginfo_values , 0 , ZEND_RETURN_VALUE , 1 )
288+ ZEND_ARG_VARIADIC_INFO (0 , value )
289+ ZEND_END_ARG_INFO ()
290+ #endif
291+
286292ZEND_BEGIN_ARG_INFO_EX (arginfo_index , 0 , ZEND_RETURN_VALUE , 1 )
287293 ZEND_ARG_INFO (0 , index )
288294ZEND_END_ARG_INFO ()
@@ -294,7 +300,11 @@ static zend_function_entry php_driver_collection_methods[] = {
294300 PHP_ME (Collection , __construct , arginfo__construct , ZEND_ACC_CTOR |ZEND_ACC_PUBLIC )
295301 PHP_ME (Collection , type , arginfo_none , ZEND_ACC_PUBLIC )
296302 PHP_ME (Collection , values , arginfo_none , ZEND_ACC_PUBLIC )
303+ #if PHP_MAJOR_VERSION >= 8
304+ PHP_ME (Collection , add , arginfo_values , ZEND_ACC_PUBLIC )
305+ #else
297306 PHP_ME (Collection , add , arginfo_value , ZEND_ACC_PUBLIC )
307+ #endif
298308 PHP_ME (Collection , get , arginfo_index , ZEND_ACC_PUBLIC )
299309 PHP_ME (Collection , find , arginfo_value , ZEND_ACC_PUBLIC )
300310 /* Countable */
@@ -313,7 +323,7 @@ static php_driver_value_handlers php_driver_collection_handlers;
313323
314324static HashTable *
315325php_driver_collection_gc (
316- #if PHP_VERSION_ID >= 80000
326+ #if PHP_MAJOR_VERSION >= 8
317327 zend_object * object ,
318328#else
319329 zval * object ,
@@ -327,7 +337,7 @@ php_driver_collection_gc(
327337
328338static HashTable *
329339php_driver_collection_properties (
330- #if PHP_VERSION_ID >= 80000
340+ #if PHP_MAJOR_VERSION >= 8
331341 zend_object * object
332342#else
333343 zval * object TSRMLS_DC
@@ -336,13 +346,11 @@ php_driver_collection_properties(
336346{
337347 php5to7_zval values ;
338348
339- php_driver_collection * self = PHP_DRIVER_GET_COLLECTION (
340- #if PHP_VERSION_ID >= 80000
341- (zval * ) object
349+ #if PHP_MAJOR_VERSION >= 8
350+ php_driver_collection * self = PHP5TO7_ZEND_OBJECT_GET (collection , object );
342351#else
343- object
352+ php_driver_collection * self = PHP_DRIVER_GET_COLLECTION ( object );
344353#endif
345- );
346354 HashTable * props = zend_std_get_properties (object TSRMLS_CC );
347355
348356 PHP5TO7_ZEND_HASH_UPDATE (props ,
@@ -361,6 +369,9 @@ php_driver_collection_properties(
361369static int
362370php_driver_collection_compare (zval * obj1 , zval * obj2 TSRMLS_DC )
363371{
372+ #if PHP_MAJOR_VERSION >= 8
373+ ZEND_COMPARE_OBJECTS_FALLBACK (obj1 , obj2 );
374+ #endif
364375 HashPosition pos1 ;
365376 HashPosition pos2 ;
366377 php5to7_zval * current1 ;
@@ -460,14 +471,10 @@ void php_driver_define_Collection(TSRMLS_D)
460471#if PHP_VERSION_ID >= 50400
461472 php_driver_collection_handlers .std .get_gc = php_driver_collection_gc ;
462473#endif
463- #if PHP_VERSION_ID >= 80000
464- php_driver_collection_handlers .std .compare = php_driver_collection_compare ;
465- #else
466- #if PHP_VERSION_ID >= 80000
474+ #if PHP_MAJOR_VERSION >= 8
467475 php_driver_collection_handlers .std .compare = php_driver_collection_compare ;
468476#else
469477 php_driver_collection_handlers .std .compare_objects = php_driver_collection_compare ;
470- #endif
471478#endif
472479 php_driver_collection_ce -> ce_flags |= PHP5TO7_ZEND_ACC_FINAL ;
473480 php_driver_collection_ce -> create_object = php_driver_collection_new ;
0 commit comments