From f8b032fdefc4f0bd1913ed2e357fabf24b626fc3 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Mon, 30 Nov 2020 21:53:50 +0000 Subject: [PATCH] Port php c extension for php8 --- php/ext/google/protobuf/array.c | 7 +- php/ext/google/protobuf/def.c | 61 +++-- php/ext/google/protobuf/map.c | 7 +- php/ext/google/protobuf/message.c | 17 +- php/ext/google/protobuf/protobuf.h | 7 + php/ext/google/protobuf/wkt.inc | 402 +++++++++++++++-------------- php/tests/ArrayTest.php | 32 +-- php/tests/GeneratedClassTest.php | 16 +- php/tests/MapFieldTest.php | 16 +- 9 files changed, 294 insertions(+), 271 deletions(-) diff --git a/php/ext/google/protobuf/array.c b/php/ext/google/protobuf/array.c index 0fa9bf0e5bb3..e6412c083258 100644 --- a/php/ext/google/protobuf/array.c +++ b/php/ext/google/protobuf/array.c @@ -453,9 +453,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetSet, 0, 0, 2) ZEND_ARG_INFO(0, newval) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_void, 0) -ZEND_END_ARG_INFO() - static zend_function_entry repeated_field_methods[] = { PHP_ME(RepeatedField, __construct, arginfo_construct, ZEND_ACC_PUBLIC) PHP_ME(RepeatedField, append, arginfo_append, ZEND_ACC_PUBLIC) @@ -636,7 +633,11 @@ void Array_ModuleInit() { h = &RepeatedField_object_handlers; memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); h->dtor_obj = RepeatedField_destructor; +#if PHP_VERSION_ID < 80000 h->compare_objects = RepeatedField_compare_objects; +#else + h->compare = RepeatedField_compare_objects; +#endif h->get_properties = RepeatedField_GetProperties; h->get_property_ptr_ptr = RepeatedField_GetPropertyPtrPtr; diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index 3f7590ca44dc..9accb1da3681 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -103,8 +103,8 @@ PHP_METHOD(EnumValueDescriptor, getNumber) { } static zend_function_entry EnumValueDescriptor_methods[] = { - PHP_ME(EnumValueDescriptor, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(EnumValueDescriptor, getNumber, NULL, ZEND_ACC_PUBLIC) + PHP_ME(EnumValueDescriptor, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(EnumValueDescriptor, getNumber, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -224,9 +224,9 @@ PHP_METHOD(EnumDescriptor, getPublicDescriptor) { } static zend_function_entry EnumDescriptor_methods[] = { - PHP_ME(EnumDescriptor, getPublicDescriptor, NULL, ZEND_ACC_PUBLIC) - PHP_ME(EnumDescriptor, getValueCount, NULL, ZEND_ACC_PUBLIC) - PHP_ME(EnumDescriptor, getValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(EnumDescriptor, getPublicDescriptor, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(EnumDescriptor, getValueCount, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(EnumDescriptor, getValue, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -316,9 +316,9 @@ PHP_METHOD(OneofDescriptor, getFieldCount) { } static zend_function_entry OneofDescriptor_methods[] = { - PHP_ME(OneofDescriptor, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(OneofDescriptor, getField, NULL, ZEND_ACC_PUBLIC) - PHP_ME(OneofDescriptor, getFieldCount, NULL, ZEND_ACC_PUBLIC) + PHP_ME(OneofDescriptor, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(OneofDescriptor, getField, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(OneofDescriptor, getFieldCount, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -480,13 +480,13 @@ PHP_METHOD(FieldDescriptor, getMessageType) { } static zend_function_entry FieldDescriptor_methods[] = { - PHP_ME(FieldDescriptor, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(FieldDescriptor, getNumber, NULL, ZEND_ACC_PUBLIC) - PHP_ME(FieldDescriptor, getLabel, NULL, ZEND_ACC_PUBLIC) - PHP_ME(FieldDescriptor, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(FieldDescriptor, isMap, NULL, ZEND_ACC_PUBLIC) - PHP_ME(FieldDescriptor, getEnumType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(FieldDescriptor, getMessageType, NULL, ZEND_ACC_PUBLIC) + PHP_ME(FieldDescriptor, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(FieldDescriptor, getNumber, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(FieldDescriptor, getLabel, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(FieldDescriptor, getType, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(FieldDescriptor, isMap, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(FieldDescriptor, getEnumType, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(FieldDescriptor, getMessageType, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -700,13 +700,13 @@ PHP_METHOD(Descriptor, getClass) { static zend_function_entry Descriptor_methods[] = { - PHP_ME(Descriptor, getClass, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Descriptor, getFullName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Descriptor, getField, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Descriptor, getFieldCount, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Descriptor, getOneofDecl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Descriptor, getOneofDeclCount, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Descriptor, getPublicDescriptor, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Descriptor, getClass, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(Descriptor, getFullName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(Descriptor, getField, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(Descriptor, getFieldCount, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(Descriptor, getOneofDecl, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(Descriptor, getOneofDeclCount, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(Descriptor, getPublicDescriptor, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1000,13 +1000,18 @@ PHP_METHOD(DescriptorPool, internalAddGeneratedFile) { upb_arena_free(arena); } +ZEND_BEGIN_ARG_INFO_EX(arginfo_addgeneratedfile, 0, 0, 2) + ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, data_len) +ZEND_END_ARG_INFO() + static zend_function_entry DescriptorPool_methods[] = { - PHP_ME(DescriptorPool, getGeneratedPool, NULL, + PHP_ME(DescriptorPool, getGeneratedPool, arginfo_void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(DescriptorPool, getDescriptorByClassName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(DescriptorPool, getDescriptorByProtoName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(DescriptorPool, getEnumDescriptorByClassName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(DescriptorPool, internalAddGeneratedFile, NULL, ZEND_ACC_PUBLIC) + PHP_ME(DescriptorPool, getDescriptorByClassName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(DescriptorPool, getDescriptorByProtoName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(DescriptorPool, getEnumDescriptorByClassName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(DescriptorPool, internalAddGeneratedFile, arginfo_addgeneratedfile, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1034,7 +1039,7 @@ PHP_METHOD(InternalDescriptorPool, getGeneratedPool) { } static zend_function_entry InternalDescriptorPool_methods[] = { - PHP_ME(InternalDescriptorPool, getGeneratedPool, NULL, + PHP_ME(InternalDescriptorPool, getGeneratedPool, arginfo_void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ZEND_FE_END }; diff --git a/php/ext/google/protobuf/map.c b/php/ext/google/protobuf/map.c index 426d56a4f9b4..26776e677e7e 100644 --- a/php/ext/google/protobuf/map.c +++ b/php/ext/google/protobuf/map.c @@ -437,9 +437,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_offsetSet, 0, 0, 2) ZEND_ARG_INFO(0, newval) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_void, 0) -ZEND_END_ARG_INFO() - static zend_function_entry MapField_methods[] = { PHP_ME(MapField, __construct, arginfo_construct, ZEND_ACC_PUBLIC) PHP_ME(MapField, offsetExists, arginfo_offsetGet, ZEND_ACC_PUBLIC) @@ -622,7 +619,11 @@ void Map_ModuleInit() { h = &MapField_object_handlers; memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); h->dtor_obj = MapField_destructor; +#if PHP_VERSION_ID < 80000 h->compare_objects = MapField_compare_objects; +#else + h->compare = MapField_compare_objects; +#endif h->get_properties = Map_GetProperties; h->get_property_ptr_ptr = Map_GetPropertyPtrPtr; diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index f15b8ac1b466..8a5a0cfa7113 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -1021,9 +1021,6 @@ PHP_METHOD(Message, writeOneof) { upb_msg_set(intern->msg, f, msgval, arena); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_mergeFrom, 0, 0, 1) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -1106,7 +1103,7 @@ PHP_METHOD(google_protobuf_Any, unpack) { if (!TryStripUrlPrefix(&type_url)) { zend_throw_exception( NULL, "Type url needs to be type.googleapis.com/fully-qualified", - 0 TSRMLS_CC); + 0); return; } @@ -1115,7 +1112,7 @@ PHP_METHOD(google_protobuf_Any, unpack) { if (m == NULL) { zend_throw_exception( NULL, "Specified message in any hasn't been added to descriptor pool", - 0 TSRMLS_CC); + 0); return; } @@ -1149,7 +1146,7 @@ PHP_METHOD(google_protobuf_Any, pack) { const char *full_name; char *buf; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &val) == + if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &val) == FAILURE) { return; } @@ -1182,7 +1179,7 @@ PHP_METHOD(google_protobuf_Any, is) { zend_class_entry *klass = NULL; const upb_msgdef *m; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "C", &klass) == + if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &klass) == FAILURE) { return; } @@ -1209,7 +1206,7 @@ PHP_METHOD(google_protobuf_Timestamp, fromDateTime) { return; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetime, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &datetime, date_interface_ce) == FAILURE) { zend_error(E_USER_ERROR, "Expect DatetimeInterface."); return; @@ -1326,7 +1323,11 @@ void Message_ModuleInit() { memcpy(h, &std_object_handlers, sizeof(zend_object_handlers)); h->dtor_obj = Message_dtor; +#if PHP_VERSION_ID < 80000 h->compare_objects = Message_compare_objects; +#else + h->compare = Message_compare_objects; +#endif h->read_property = Message_read_property; h->write_property = Message_write_property; h->has_property = Message_has_property; diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index fe0b5a714772..322567ec70a3 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -69,6 +69,13 @@ const zval *get_generated_pool(); #define PROTO_STRLEN_P(obj) ZSTR_LEN(obj) #endif +ZEND_BEGIN_ARG_INFO(arginfo_void, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_setter, 0, 0, 1) + ZEND_ARG_INFO(0, value) +ZEND_END_ARG_INFO() + #define PHP_PROTOBUF_VERSION "3.14.0" // ptr -> PHP object cache. This is a weak map that caches lazily-created diff --git a/php/ext/google/protobuf/wkt.inc b/php/ext/google/protobuf/wkt.inc index 573ff30c1478..401f2e825b0c 100644 --- a/php/ext/google/protobuf/wkt.inc +++ b/php/ext/google/protobuf/wkt.inc @@ -37,7 +37,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_Any, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_Any_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_Any, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_Any, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -103,15 +103,19 @@ static PHP_METHOD(google_protobuf_Any, setValue) { RETURN_ZVAL(getThis(), 1, 0); } +ZEND_BEGIN_ARG_INFO_EX(arginfo_is, 0, 0, 1) + ZEND_ARG_INFO(0, proto) +ZEND_END_ARG_INFO() + static zend_function_entry google_protobuf_Any_phpmethods[] = { - PHP_ME(google_protobuf_Any, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Any, getTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Any, setTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Any, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Any, setValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Any, is, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Any, pack, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Any, unpack, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, getTypeUrl, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, setTypeUrl, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, setValue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, is, arginfo_is, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, pack, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Any, unpack, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -178,7 +182,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_Api, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_Api_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_Api, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_Api, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -355,21 +359,21 @@ static PHP_METHOD(google_protobuf_Api, setSyntax) { } static zend_function_entry google_protobuf_Api_phpmethods[] = { - PHP_ME(google_protobuf_Api, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, getMethods, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, setMethods, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, getOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, setOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, getVersion, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, setVersion, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, getSourceContext, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, setSourceContext, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, getMixins, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, setMixins, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, getSyntax, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Api, setSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getMethods, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setMethods, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getOptions, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setOptions, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getVersion, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setVersion, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getSourceContext, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setSourceContext, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getMixins, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setMixins, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, getSyntax, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Api, setSyntax, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -549,21 +553,21 @@ static PHP_METHOD(google_protobuf_Method, setSyntax) { } static zend_function_entry google_protobuf_Method_phpmethods[] = { - PHP_ME(google_protobuf_Method, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, getRequestTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, setRequestTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, getRequestStreaming, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, setRequestStreaming, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, getResponseTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, setResponseTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, getResponseStreaming, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, setResponseStreaming, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, getOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, setOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, getSyntax, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Method, setSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getRequestTypeUrl, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setRequestTypeUrl, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getRequestStreaming, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setRequestStreaming, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getResponseTypeUrl, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setResponseTypeUrl, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getResponseStreaming, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setResponseStreaming, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getOptions, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setOptions, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, getSyntax, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Method, setSyntax, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -633,11 +637,11 @@ static PHP_METHOD(google_protobuf_Mixin, setRoot) { } static zend_function_entry google_protobuf_Mixin_phpmethods[] = { - PHP_ME(google_protobuf_Mixin, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Mixin, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Mixin, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Mixin, getRoot, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Mixin, setRoot, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, getRoot, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Mixin, setRoot, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -681,7 +685,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_Duration, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_Duration_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_Duration, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_Duration, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -748,11 +752,11 @@ static PHP_METHOD(google_protobuf_Duration, setNanos) { } static zend_function_entry google_protobuf_Duration_phpmethods[] = { - PHP_ME(google_protobuf_Duration, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Duration, getSeconds, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Duration, setSeconds, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Duration, getNanos, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Duration, setNanos, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, getSeconds, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, setSeconds, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, getNanos, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Duration, setNanos, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -794,7 +798,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_GPBEmpty, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_GPBEmpty_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_GPBEmpty, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_GPBEmpty, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -817,7 +821,7 @@ static PHP_METHOD(google_protobuf_Empty, __construct) { } static zend_function_entry google_protobuf_Empty_phpmethods[] = { - PHP_ME(google_protobuf_Empty, __construct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Empty, __construct, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -860,7 +864,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_FieldMask, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_FieldMask_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_FieldMask, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_FieldMask, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -905,9 +909,9 @@ static PHP_METHOD(google_protobuf_FieldMask, setPaths) { } static zend_function_entry google_protobuf_FieldMask_phpmethods[] = { - PHP_ME(google_protobuf_FieldMask, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_FieldMask, getPaths, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_FieldMask, setPaths, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FieldMask, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FieldMask, getPaths, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FieldMask, setPaths, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -951,7 +955,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_SourceContext, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_SourceContext_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_SourceContext, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_SourceContext, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -996,9 +1000,9 @@ static PHP_METHOD(google_protobuf_SourceContext, setFileName) { } static zend_function_entry google_protobuf_SourceContext_phpmethods[] = { - PHP_ME(google_protobuf_SourceContext, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_SourceContext, getFileName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_SourceContext, setFileName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_SourceContext, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_SourceContext, getFileName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_SourceContext, setFileName, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1058,7 +1062,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_Struct, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_Struct_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_Struct, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_Struct, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -1103,9 +1107,9 @@ static PHP_METHOD(google_protobuf_Struct, setFields) { } static zend_function_entry google_protobuf_Struct_phpmethods[] = { - PHP_ME(google_protobuf_Struct, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Struct, getFields, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Struct, setFields, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct, getFields, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct, setFields, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1175,11 +1179,11 @@ static PHP_METHOD(google_protobuf_Struct_FieldsEntry, setValue) { } static zend_function_entry google_protobuf_Struct_FieldsEntry_phpmethods[] = { - PHP_ME(google_protobuf_Struct_FieldsEntry, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Struct_FieldsEntry, getKey, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Struct_FieldsEntry, setKey, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Struct_FieldsEntry, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Struct_FieldsEntry, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, getKey, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, setKey, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Struct_FieldsEntry, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1344,20 +1348,20 @@ static PHP_METHOD(google_protobuf_Value, getKind) { RETURN_STRING(field ? upb_fielddef_name(field) : ""); } static zend_function_entry google_protobuf_Value_phpmethods[] = { - PHP_ME(google_protobuf_Value, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, getNullValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, setNullValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, getNumberValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, setNumberValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, getStringValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, setStringValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, getBoolValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, setBoolValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, getStructValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, setStructValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, getListValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, setListValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Value, getKind, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getNullValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setNullValue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getNumberValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setNumberValue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getStringValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setStringValue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getBoolValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setBoolValue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getStructValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setStructValue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getListValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, setListValue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Value, getKind, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1405,9 +1409,9 @@ static PHP_METHOD(google_protobuf_ListValue, setValues) { } static zend_function_entry google_protobuf_ListValue_phpmethods[] = { - PHP_ME(google_protobuf_ListValue, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_ListValue, getValues, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_ListValue, setValues, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_ListValue, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_ListValue, getValues, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_ListValue, setValues, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1433,7 +1437,7 @@ PHP_METHOD(google_protobuf_NullValue, name) { const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.NullValue"); const char *name; zend_long value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) { return; } @@ -1455,7 +1459,7 @@ PHP_METHOD(google_protobuf_NullValue, value) { char *name = NULL; size_t name_len; int32_t num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { return; } @@ -1470,8 +1474,8 @@ PHP_METHOD(google_protobuf_NullValue, value) { } static zend_function_entry google_protobuf_NullValue_phpmethods[] = { - PHP_ME(google_protobuf_NullValue, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(google_protobuf_NullValue, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_NullValue, name, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_NullValue, value, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -1570,7 +1574,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_Type, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_Type_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_Type, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_Type, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -1725,19 +1729,19 @@ static PHP_METHOD(google_protobuf_Type, setSyntax) { } static zend_function_entry google_protobuf_Type_phpmethods[] = { - PHP_ME(google_protobuf_Type, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, getFields, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, setFields, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, getOneofs, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, setOneofs, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, getOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, setOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, getSourceContext, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, setSourceContext, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, getSyntax, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Type, setSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getFields, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setFields, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getOneofs, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setOneofs, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getOptions, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setOptions, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getSourceContext, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setSourceContext, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, getSyntax, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Type, setSyntax, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -1983,27 +1987,27 @@ static PHP_METHOD(google_protobuf_Field, setDefaultValue) { } static zend_function_entry google_protobuf_Field_phpmethods[] = { - PHP_ME(google_protobuf_Field, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getKind, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setKind, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getCardinality, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setCardinality, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getNumber, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setNumber, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setTypeUrl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getOneofIndex, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setOneofIndex, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getPacked, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setPacked, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getJsonName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setJsonName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, getDefaultValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Field, setDefaultValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getKind, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setKind, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getCardinality, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setCardinality, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getNumber, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setNumber, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getTypeUrl, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setTypeUrl, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getOneofIndex, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setOneofIndex, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getPacked, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setPacked, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getOptions, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setOptions, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getJsonName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setJsonName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, getDefaultValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Field, setDefaultValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2029,7 +2033,7 @@ PHP_METHOD(google_protobuf_Field_Kind, name) { const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Field.Kind"); const char *name; zend_long value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) { return; } @@ -2051,7 +2055,7 @@ PHP_METHOD(google_protobuf_Field_Kind, value) { char *name = NULL; size_t name_len; int32_t num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { return; } @@ -2066,8 +2070,8 @@ PHP_METHOD(google_protobuf_Field_Kind, value) { } static zend_function_entry google_protobuf_Field_Kind_phpmethods[] = { - PHP_ME(google_protobuf_Field_Kind, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(google_protobuf_Field_Kind, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Field_Kind, name, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Field_Kind, value, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -2128,7 +2132,7 @@ PHP_METHOD(google_protobuf_Field_Cardinality, name) { const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Field.Cardinality"); const char *name; zend_long value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) { return; } @@ -2150,7 +2154,7 @@ PHP_METHOD(google_protobuf_Field_Cardinality, value) { char *name = NULL; size_t name_len; int32_t num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { return; } @@ -2165,8 +2169,8 @@ PHP_METHOD(google_protobuf_Field_Cardinality, value) { } static zend_function_entry google_protobuf_Field_Cardinality_phpmethods[] = { - PHP_ME(google_protobuf_Field_Cardinality, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(google_protobuf_Field_Cardinality, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Field_Cardinality, name, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Field_Cardinality, value, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -2307,17 +2311,17 @@ static PHP_METHOD(google_protobuf_Enum, setSyntax) { } static zend_function_entry google_protobuf_Enum_phpmethods[] = { - PHP_ME(google_protobuf_Enum, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, getEnumvalue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, setEnumvalue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, getOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, setOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, getSourceContext, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, setSourceContext, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, getSyntax, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Enum, setSyntax, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getEnumvalue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setEnumvalue, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getOptions, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setOptions, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getSourceContext, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setSourceContext, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, getSyntax, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Enum, setSyntax, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2409,13 +2413,13 @@ static PHP_METHOD(google_protobuf_EnumValue, setOptions) { } static zend_function_entry google_protobuf_EnumValue_phpmethods[] = { - PHP_ME(google_protobuf_EnumValue, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_EnumValue, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_EnumValue, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_EnumValue, getNumber, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_EnumValue, setNumber, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_EnumValue, getOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_EnumValue, setOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, getNumber, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, setNumber, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, getOptions, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_EnumValue, setOptions, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2485,11 +2489,11 @@ static PHP_METHOD(google_protobuf_Option, setValue) { } static zend_function_entry google_protobuf_Option_phpmethods[] = { - PHP_ME(google_protobuf_Option, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Option, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Option, setName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Option, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Option, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, getName, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, setName, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Option, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2515,7 +2519,7 @@ PHP_METHOD(google_protobuf_Syntax, name) { const upb_enumdef *e = upb_symtab_lookupenum(symtab, "google.protobuf.Syntax"); const char *name; zend_long value; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &value) == + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) { return; } @@ -2537,7 +2541,7 @@ PHP_METHOD(google_protobuf_Syntax, value) { char *name = NULL; size_t name_len; int32_t num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) { return; } @@ -2552,8 +2556,8 @@ PHP_METHOD(google_protobuf_Syntax, value) { } static zend_function_entry google_protobuf_Syntax_phpmethods[] = { - PHP_ME(google_protobuf_Syntax, name, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(google_protobuf_Syntax, value, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Syntax, name, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(google_protobuf_Syntax, value, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -2598,7 +2602,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_Timestamp, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_Timestamp_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_Timestamp, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_Timestamp, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -2664,14 +2668,18 @@ static PHP_METHOD(google_protobuf_Timestamp, setNanos) { RETURN_ZVAL(getThis(), 1, 0); } +ZEND_BEGIN_ARG_INFO_EX(arginfo_timestamp_fromdatetime, 0, 0, 1) + ZEND_ARG_INFO(0, datetime) +ZEND_END_ARG_INFO() + static zend_function_entry google_protobuf_Timestamp_phpmethods[] = { - PHP_ME(google_protobuf_Timestamp, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Timestamp, getSeconds, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Timestamp, setSeconds, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Timestamp, getNanos, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Timestamp, setNanos, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Timestamp, fromDateTime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Timestamp, toDateTime, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, getSeconds, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, setSeconds, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, getNanos, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, setNanos, arginfo_setter, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, fromDateTime, arginfo_timestamp_fromdatetime, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Timestamp, toDateTime, arginfo_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2724,7 +2732,7 @@ static PHP_METHOD(GPBMetadata_Google_Protobuf_Wrappers, initOnce) { } static zend_function_entry GPBMetadata_Google_Protobuf_Wrappers_methods[] = { - PHP_ME(GPBMetadata_Google_Protobuf_Wrappers, initOnce, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(GPBMetadata_Google_Protobuf_Wrappers, initOnce, arginfo_void, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) ZEND_FE_END }; @@ -2769,9 +2777,9 @@ static PHP_METHOD(google_protobuf_DoubleValue, setValue) { } static zend_function_entry google_protobuf_DoubleValue_phpmethods[] = { - PHP_ME(google_protobuf_DoubleValue, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_DoubleValue, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_DoubleValue, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_DoubleValue, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_DoubleValue, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_DoubleValue, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2819,9 +2827,9 @@ static PHP_METHOD(google_protobuf_FloatValue, setValue) { } static zend_function_entry google_protobuf_FloatValue_phpmethods[] = { - PHP_ME(google_protobuf_FloatValue, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_FloatValue, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_FloatValue, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FloatValue, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FloatValue, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_FloatValue, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2869,9 +2877,9 @@ static PHP_METHOD(google_protobuf_Int64Value, setValue) { } static zend_function_entry google_protobuf_Int64Value_phpmethods[] = { - PHP_ME(google_protobuf_Int64Value, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Int64Value, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Int64Value, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int64Value, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int64Value, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int64Value, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2919,9 +2927,9 @@ static PHP_METHOD(google_protobuf_UInt64Value, setValue) { } static zend_function_entry google_protobuf_UInt64Value_phpmethods[] = { - PHP_ME(google_protobuf_UInt64Value, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_UInt64Value, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_UInt64Value, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt64Value, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt64Value, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt64Value, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -2969,9 +2977,9 @@ static PHP_METHOD(google_protobuf_Int32Value, setValue) { } static zend_function_entry google_protobuf_Int32Value_phpmethods[] = { - PHP_ME(google_protobuf_Int32Value, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Int32Value, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_Int32Value, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int32Value, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int32Value, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_Int32Value, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -3019,9 +3027,9 @@ static PHP_METHOD(google_protobuf_UInt32Value, setValue) { } static zend_function_entry google_protobuf_UInt32Value_phpmethods[] = { - PHP_ME(google_protobuf_UInt32Value, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_UInt32Value, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_UInt32Value, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt32Value, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt32Value, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_UInt32Value, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -3069,9 +3077,9 @@ static PHP_METHOD(google_protobuf_BoolValue, setValue) { } static zend_function_entry google_protobuf_BoolValue_phpmethods[] = { - PHP_ME(google_protobuf_BoolValue, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_BoolValue, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_BoolValue, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BoolValue, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BoolValue, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BoolValue, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -3119,9 +3127,9 @@ static PHP_METHOD(google_protobuf_StringValue, setValue) { } static zend_function_entry google_protobuf_StringValue_phpmethods[] = { - PHP_ME(google_protobuf_StringValue, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_StringValue, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_StringValue, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_StringValue, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_StringValue, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_StringValue, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; @@ -3169,9 +3177,9 @@ static PHP_METHOD(google_protobuf_BytesValue, setValue) { } static zend_function_entry google_protobuf_BytesValue_phpmethods[] = { - PHP_ME(google_protobuf_BytesValue, __construct, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_BytesValue, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(google_protobuf_BytesValue, setValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BytesValue, __construct, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BytesValue, getValue, arginfo_void, ZEND_ACC_PUBLIC) + PHP_ME(google_protobuf_BytesValue, setValue, arginfo_setter, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/php/tests/ArrayTest.php b/php/tests/ArrayTest.php index 2f5d693cacda..318a5ce0c373 100644 --- a/php/tests/ArrayTest.php +++ b/php/tests/ArrayTest.php @@ -296,15 +296,15 @@ public function testFloat() // Test append. $arr[] = 1; - $this->assertEquals(1.0, $arr[0], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $arr[0], MAX_FLOAT_DIFF); $arr[] = 1.1; - $this->assertEquals(1.1, $arr[1], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $arr[1], MAX_FLOAT_DIFF); $arr[] = '2'; - $this->assertEquals(2.0, $arr[2], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $arr[2], MAX_FLOAT_DIFF); $arr[] = '3.1'; - $this->assertEquals(3.1, $arr[3], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $arr[3], MAX_FLOAT_DIFF); $this->assertEquals(4, count($arr)); @@ -315,15 +315,15 @@ public function testFloat() // Test set. $arr[0] = 1; - $this->assertEquals(1.0, $arr[0], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $arr[0], MAX_FLOAT_DIFF); $arr[1] = 1.1; - $this->assertEquals(1.1, $arr[1], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $arr[1], MAX_FLOAT_DIFF); $arr[2] = '2'; - $this->assertEquals(2.0, $arr[2], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $arr[2], MAX_FLOAT_DIFF); $arr[3] = '3.1'; - $this->assertEquals(3.1, $arr[3], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $arr[3], MAX_FLOAT_DIFF); } ######################################################### @@ -336,15 +336,15 @@ public function testDouble() // Test append. $arr[] = 1; - $this->assertEquals(1.0, $arr[0], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $arr[0], MAX_FLOAT_DIFF); $arr[] = 1.1; - $this->assertEquals(1.1, $arr[1], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $arr[1], MAX_FLOAT_DIFF); $arr[] = '2'; - $this->assertEquals(2.0, $arr[2], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $arr[2], MAX_FLOAT_DIFF); $arr[] = '3.1'; - $this->assertEquals(3.1, $arr[3], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $arr[3], MAX_FLOAT_DIFF); $this->assertEquals(4, count($arr)); @@ -355,15 +355,15 @@ public function testDouble() // Test set. $arr[0] = 1; - $this->assertEquals(1.0, $arr[0], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $arr[0], MAX_FLOAT_DIFF); $arr[1] = 1.1; - $this->assertEquals(1.1, $arr[1], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $arr[1], MAX_FLOAT_DIFF); $arr[2] = '2'; - $this->assertEquals(2.0, $arr[2], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $arr[2], MAX_FLOAT_DIFF); $arr[3] = '3.1'; - $this->assertEquals(3.1, $arr[3], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $arr[3], MAX_FLOAT_DIFF); } ######################################################### diff --git a/php/tests/GeneratedClassTest.php b/php/tests/GeneratedClassTest.php index 1e97ff2460cc..ba4d08e3e8c1 100644 --- a/php/tests/GeneratedClassTest.php +++ b/php/tests/GeneratedClassTest.php @@ -313,17 +313,17 @@ public function testFloatField() // Set integer. $m->setOptionalFloat(1); - $this->assertEquals(1.0, $m->getOptionalFloat(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $m->getOptionalFloat(), MAX_FLOAT_DIFF); // Set float. $m->setOptionalFloat(1.1); - $this->assertEquals(1.1, $m->getOptionalFloat(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $m->getOptionalFloat(), MAX_FLOAT_DIFF); // Set string. $m->setOptionalFloat('2'); - $this->assertEquals(2.0, $m->getOptionalFloat(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $m->getOptionalFloat(), MAX_FLOAT_DIFF); $m->setOptionalFloat('3.1'); - $this->assertEquals(3.1, $m->getOptionalFloat(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $m->getOptionalFloat(), MAX_FLOAT_DIFF); } ######################################################### @@ -336,17 +336,17 @@ public function testDoubleField() // Set integer. $m->setOptionalDouble(1); - $this->assertEquals(1.0, $m->getOptionalDouble(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $m->getOptionalDouble(), MAX_FLOAT_DIFF); // Set float. $m->setOptionalDouble(1.1); - $this->assertEquals(1.1, $m->getOptionalDouble(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $m->getOptionalDouble(), MAX_FLOAT_DIFF); // Set string. $m->setOptionalDouble('2'); - $this->assertEquals(2.0, $m->getOptionalDouble(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $m->getOptionalDouble(), MAX_FLOAT_DIFF); $m->setOptionalDouble('3.1'); - $this->assertEquals(3.1, $m->getOptionalDouble(), '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $m->getOptionalDouble(), MAX_FLOAT_DIFF); } ######################################################### diff --git a/php/tests/MapFieldTest.php b/php/tests/MapFieldTest.php index e7f55d71253e..9e37c482483b 100644 --- a/php/tests/MapFieldTest.php +++ b/php/tests/MapFieldTest.php @@ -257,15 +257,15 @@ public function testFloat() { // Test set. $arr[0] = 1; - $this->assertEquals(1.0, $arr[0], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $arr[0], MAX_FLOAT_DIFF); $arr[1] = 1.1; - $this->assertEquals(1.1, $arr[1], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $arr[1], MAX_FLOAT_DIFF); $arr[2] = '2'; - $this->assertEquals(2.0, $arr[2], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $arr[2], MAX_FLOAT_DIFF); $arr[3] = '3.1'; - $this->assertEquals(3.1, $arr[3], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $arr[3], MAX_FLOAT_DIFF); $this->assertEquals(4, count($arr)); } @@ -279,15 +279,15 @@ public function testDouble() { // Test set. $arr[0] = 1; - $this->assertEquals(1.0, $arr[0], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.0, $arr[0], MAX_FLOAT_DIFF); $arr[1] = 1.1; - $this->assertEquals(1.1, $arr[1], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(1.1, $arr[1], MAX_FLOAT_DIFF); $arr[2] = '2'; - $this->assertEquals(2.0, $arr[2], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(2.0, $arr[2], MAX_FLOAT_DIFF); $arr[3] = '3.1'; - $this->assertEquals(3.1, $arr[3], '', MAX_FLOAT_DIFF); + $this->assertEqualsWithDelta(3.1, $arr[3], MAX_FLOAT_DIFF); $this->assertEquals(4, count($arr)); }