From 112dd234436dfb8bfc92dcf20fdefb6c74070c64 Mon Sep 17 00:00:00 2001 From: qkdreyer Date: Thu, 29 Dec 2022 15:11:40 +0100 Subject: [PATCH] feat: add php 8.2 compatibility --- ext/php_driver.h | 18 +++++++++++++----- ext/src/Bigint.c | 4 +++- ext/src/Blob.c | 4 +++- ext/src/Date.c | 4 +++- ext/src/Decimal.c | 4 +++- ext/src/Duration.c | 4 +++- ext/src/Float.c | 4 +++- ext/src/Inet.c | 4 +++- ext/src/Smallint.c | 4 +++- ext/src/Time.c | 4 +++- ext/src/Timestamp.c | 4 +++- ext/src/Timeuuid.c | 4 +++- ext/src/Tinyint.c | 4 +++- ext/src/Type.c | 4 +++- ext/src/Type/Collection.c | 3 ++- ext/src/Type/Custom.c | 4 +++- ext/src/Type/Scalar.c | 4 +++- ext/src/Type/Set.c | 3 ++- ext/src/Type/Tuple.c | 3 ++- ext/src/Uuid.c | 4 +++- ext/src/Varint.c | 4 +++- 21 files changed, 70 insertions(+), 25 deletions(-) diff --git a/ext/php_driver.h b/ext/php_driver.h index c80b8fc2d..0b22e2d99 100644 --- a/ext/php_driver.h +++ b/ext/php_driver.h @@ -129,6 +129,9 @@ typedef zend_object php7to8_object; #define PHP7TO8_ARG_INFO_VOID_RETURN(arginfo) \ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo, 0, 0, IS_VOID, 0) \ ZEND_END_ARG_INFO() +#define PHP7TO8_ARG_INFO_STRING_RETURN(arginfo) \ + ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo, 0, 0, IS_STRING, 0) \ + ZEND_END_ARG_INFO() #define PHP7TO8_ARG_INFO_BOOL_RETURN(arginfo) \ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo, 0, 0, _IS_BOOL, 0) \ ZEND_END_ARG_INFO() @@ -172,6 +175,9 @@ typedef zval php7to8_object; #define PHP7TO8_ARG_INFO_VOID_RETURN(arginfo) \ ZEND_BEGIN_ARG_INFO_EX(arginfo, 0, ZEND_RETURN_VALUE, 0) \ ZEND_END_ARG_INFO() +#define PHP7TO8_ARG_INFO_STRING_RETURN(arginfo) \ + ZEND_BEGIN_ARG_INFO_EX(arginfo, 0, ZEND_RETURN_VALUE, 0) \ + ZEND_END_ARG_INFO() #define PHP7TO8_ARG_INFO_BOOL_RETURN(arginfo) \ ZEND_BEGIN_ARG_INFO_EX(arginfo, 0, ZEND_RETURN_VALUE, 0) \ ZEND_END_ARG_INFO() @@ -200,6 +206,12 @@ typedef zval php7to8_object; ZEND_END_ARG_INFO() #endif +#if ((PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION > 8) +#define PHP7TO82_ZEND_KEY() __key ? __key->val : NULL +#else +#define PHP7TO82_ZEND_KEY() _p->key ? _p->key->val : NULL +#endif + #if PHP_MAJOR_VERSION >= 7 #define php5to7_zend_register_internal_class_ex(ce, parent_ce) zend_register_internal_class_ex((ce), (parent_ce) TSRMLS_CC); @@ -276,11 +288,7 @@ php5to7_string_compare(php5to7_string s1, php5to7_string s2) #define PHP5TO7_ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) \ ZEND_HASH_FOREACH(ht, 0); \ - if (_p->key) { \ - (_key) = _p->key->val; \ - } else { \ - (_key) = NULL; \ - } \ + _key = PHP7TO82_ZEND_KEY(); \ _val = _z; #define PHP5TO7_ZEND_HASH_FOREACH_END(ht) ZEND_HASH_FOREACH_END() diff --git a/ext/src/Bigint.c b/ext/src/Bigint.c index 7456b27a8..4323b1eb6 100644 --- a/ext/src/Bigint.c +++ b/ext/src/Bigint.c @@ -371,9 +371,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_num, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, num) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_bigint_methods[] = { PHP_ME(Bigint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Bigint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Bigint, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Bigint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Bigint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Bigint, add, arginfo_num, ZEND_ACC_PUBLIC) diff --git a/ext/src/Blob.c b/ext/src/Blob.c index f3600ef0b..fb9af45f3 100644 --- a/ext/src/Blob.c +++ b/ext/src/Blob.c @@ -101,9 +101,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_blob_methods[] = { PHP_ME(Blob, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Blob, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Blob, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Blob, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Blob, bytes, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Blob, toBinaryString, arginfo_none, ZEND_ACC_PUBLIC) diff --git a/ext/src/Date.c b/ext/src/Date.c index 8a54cce3c..15f7d7ad7 100644 --- a/ext/src/Date.c +++ b/ext/src/Date.c @@ -180,13 +180,15 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_date_methods[] = { PHP_ME(Date, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME(Date, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Date, seconds, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Date, toDateTime, arginfo_time, ZEND_ACC_PUBLIC) PHP_ME(Date, fromDateTime, arginfo_datetime, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Date, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Date, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Decimal.c b/ext/src/Decimal.c index 407231b9e..79d89fb1e 100644 --- a/ext/src/Decimal.c +++ b/ext/src/Decimal.c @@ -490,9 +490,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_num, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, num) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_decimal_methods[] = { PHP_ME(Decimal, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Decimal, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Decimal, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Decimal, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Decimal, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Decimal, scale, arginfo_none, ZEND_ACC_PUBLIC) diff --git a/ext/src/Duration.c b/ext/src/Duration.c index dac34a3fb..4cf1893e5 100644 --- a/ext/src/Duration.c +++ b/ext/src/Duration.c @@ -213,13 +213,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo__construct, 0, ZEND_RETURN_VALUE, 3) ZEND_ARG_INFO(0, nanos) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_duration_methods[] = { PHP_ME(Duration, __construct, arginfo__construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_ME(Duration, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Duration, months, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Duration, days, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Duration, nanos, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Duration, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Duration, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Float.c b/ext/src/Float.c index 8a138fd42..4bc3bbdaf 100644 --- a/ext/src/Float.c +++ b/ext/src/Float.c @@ -346,9 +346,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_num, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, num) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_float_methods[] = { PHP_ME(Float, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Float, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Float, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Float, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Float, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Float, isInfinite, arginfo_none, ZEND_ACC_PUBLIC) diff --git a/ext/src/Inet.c b/ext/src/Inet.c index c9f25e4de..2999f9f03 100644 --- a/ext/src/Inet.c +++ b/ext/src/Inet.c @@ -90,9 +90,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_inet_methods[] = { PHP_ME(Inet, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Inet, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Inet, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Inet, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Inet, address, arginfo_none, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/src/Smallint.c b/ext/src/Smallint.c index 91704c61d..c2ac28118 100644 --- a/ext/src/Smallint.c +++ b/ext/src/Smallint.c @@ -403,9 +403,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_num, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, num) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_smallint_methods[] = { PHP_ME(Smallint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Smallint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Smallint, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Smallint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Smallint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Smallint, add, arginfo_num, ZEND_ACC_PUBLIC) diff --git a/ext/src/Time.c b/ext/src/Time.c index 2f325623c..8a6eeab69 100644 --- a/ext/src/Time.c +++ b/ext/src/Time.c @@ -205,12 +205,14 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_time_methods[] = { PHP_ME(Time, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME(Time, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Time, seconds, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Time, fromDateTime, arginfo_datetime, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Time, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Time, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Timestamp.c b/ext/src/Timestamp.c index a1112b671..55e4bb170 100644 --- a/ext/src/Timestamp.c +++ b/ext/src/Timestamp.c @@ -173,13 +173,15 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_timestamp_methods[] = { PHP_ME(Timestamp, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME(Timestamp, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Timestamp, time, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Timestamp, microtime, arginfo_microtime, ZEND_ACC_PUBLIC) PHP_ME(Timestamp, toDateTime, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(Timestamp, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Timestamp, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Timeuuid.c b/ext/src/Timeuuid.c index 19723be0e..2fa504524 100644 --- a/ext/src/Timeuuid.c +++ b/ext/src/Timeuuid.c @@ -169,9 +169,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_timeuuid_methods[] = { PHP_ME(Timeuuid, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Timeuuid, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Timeuuid, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Timeuuid, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Timeuuid, uuid, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Timeuuid, version, arginfo_none, ZEND_ACC_PUBLIC) diff --git a/ext/src/Tinyint.c b/ext/src/Tinyint.c index e8cf098a7..f49123d8e 100644 --- a/ext/src/Tinyint.c +++ b/ext/src/Tinyint.c @@ -402,9 +402,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_num, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, num) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_tinyint_methods[] = { PHP_ME(Tinyint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Tinyint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Tinyint, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Tinyint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Tinyint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Tinyint, add, arginfo_num, ZEND_ACC_PUBLIC) diff --git a/ext/src/Type.c b/ext/src/Type.c index 605321041..eab5eb608 100644 --- a/ext/src/Type.c +++ b/ext/src/Type.c @@ -207,9 +207,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_map, 0, ZEND_RETURN_VALUE, 2) PHP_DRIVER_NAMESPACE_ZEND_ARG_OBJ_INFO(0, valueType, Type, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_type_methods[] = { PHP_ABSTRACT_ME(Type, name, arginfo_none) - PHP_ABSTRACT_ME(Type, __toString, arginfo_none) + PHP_ABSTRACT_ME(Type, __toString, arginfo_string_return) #define XX_SCALAR_METHOD(name, _) PHP_ME(Type, name, arginfo_none, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL) PHP_DRIVER_SCALAR_TYPES_MAP(XX_SCALAR_METHOD) diff --git a/ext/src/Type/Collection.c b/ext/src/Type/Collection.c index 9fcd35c24..4035f7c7c 100644 --- a/ext/src/Type/Collection.c +++ b/ext/src/Type/Collection.c @@ -113,12 +113,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() PHP7TO8_ARG_INFO_VARIADIC(arginfo_value, value) +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) static zend_function_entry php_driver_type_collection_methods[] = { PHP_ME(TypeCollection, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeCollection, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeCollection, valueType, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(TypeCollection, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(TypeCollection, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(TypeCollection, create, arginfo_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Type/Custom.c b/ext/src/Type/Custom.c index ddaf3fbeb..59167ebb7 100644 --- a/ext/src/Type/Custom.c +++ b/ext/src/Type/Custom.c @@ -69,10 +69,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_type_custom_methods[] = { PHP_ME(TypeCustom, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeCustom, name, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(TypeCustom, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(TypeCustom, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(TypeCustom, create, arginfo_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Type/Scalar.c b/ext/src/Type/Scalar.c index 0c25818d4..604d85e63 100644 --- a/ext/src/Type/Scalar.c +++ b/ext/src/Type/Scalar.c @@ -72,10 +72,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, ZEND_RETURN_VALUE, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_type_scalar_methods[] = { PHP_ME(TypeScalar, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeScalar, name, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(TypeScalar, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(TypeScalar, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(TypeScalar, create, arginfo_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Type/Set.c b/ext/src/Type/Set.c index 70211e37e..25d072671 100644 --- a/ext/src/Type/Set.c +++ b/ext/src/Type/Set.c @@ -105,12 +105,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() PHP7TO8_ARG_INFO_VARIADIC(arginfo_value, value) +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) static zend_function_entry php_driver_type_set_methods[] = { PHP_ME(TypeSet, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeSet, name, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeSet, valueType, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(TypeSet, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(TypeSet, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(TypeSet, create, arginfo_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/src/Type/Tuple.c b/ext/src/Type/Tuple.c index 58f25c56a..a58598bf8 100644 --- a/ext/src/Type/Tuple.c +++ b/ext/src/Type/Tuple.c @@ -141,11 +141,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() PHP7TO8_ARG_INFO_VARIADIC(arginfo_values, values) +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) static zend_function_entry php_driver_type_tuple_methods[] = { PHP_ME(TypeTuple, __construct, arginfo_none, ZEND_ACC_PRIVATE) PHP_ME(TypeTuple, name, arginfo_none, ZEND_ACC_PUBLIC) - PHP_ME(TypeTuple, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(TypeTuple, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(TypeTuple, types, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(TypeTuple, create, arginfo_values, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/src/Uuid.c b/ext/src/Uuid.c index 1cd5aad29..d7d93eeb1 100644 --- a/ext/src/Uuid.c +++ b/ext/src/Uuid.c @@ -106,9 +106,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_none, 0, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_uuid_methods[] = { PHP_ME(Uuid, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Uuid, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Uuid, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Uuid, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Uuid, uuid, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Uuid, version, arginfo_none, ZEND_ACC_PUBLIC) diff --git a/ext/src/Varint.c b/ext/src/Varint.c index 5d21fec8b..b86446145 100644 --- a/ext/src/Varint.c +++ b/ext/src/Varint.c @@ -350,9 +350,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_num, 0, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, num) ZEND_END_ARG_INFO() +PHP7TO8_ARG_INFO_STRING_RETURN(arginfo_string_return) + static zend_function_entry php_driver_varint_methods[] = { PHP_ME(Varint, __construct, arginfo__construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(Varint, __toString, arginfo_none, ZEND_ACC_PUBLIC) + PHP_ME(Varint, __toString, arginfo_string_return, ZEND_ACC_PUBLIC) PHP_ME(Varint, type, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Varint, value, arginfo_none, ZEND_ACC_PUBLIC) PHP_ME(Varint, add, arginfo_num, ZEND_ACC_PUBLIC)