diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2018-07-12 12:34:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-12 12:34:18 -0700 |
commit | 22503a01722939385a7584c3b65f1c43dc5b2ef8 (patch) | |
tree | d6e5dbe9f854052d729dfd29f28929068be531e0 /php/ext/google/protobuf/message.c | |
parent | e529d162838f747362c123ec10e87ebe3970c677 (diff) | |
download | protobuf-22503a01722939385a7584c3b65f1c43dc5b2ef8.tar.gz protobuf-22503a01722939385a7584c3b65f1c43dc5b2ef8.tar.bz2 protobuf-22503a01722939385a7584c3b65f1c43dc5b2ef8.zip |
fix for API change in PHP 7.3 (#4898)
Diffstat (limited to 'php/ext/google/protobuf/message.c')
-rw-r--r-- | php/ext/google/protobuf/message.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index e28e42a1..a40e0f63 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -869,7 +869,11 @@ PHP_PROTO_INIT_ENUMCLASS_START("Google\\Protobuf\\Field\\Cardinality", zend_declare_class_constant_long(field_cardinality_type, "CARDINALITY_REPEATED", 20, 3 TSRMLS_CC); const char *alias = "Google\\Protobuf\\Field_Cardinality"; +#if PHP_VERSION_ID < 70300 zend_register_class_alias_ex(alias, strlen(alias), field_cardinality_type TSRMLS_CC); +#else + zend_register_class_alias_ex(alias, strlen(alias), field_cardinality_type, 1); +#endif PHP_PROTO_INIT_ENUMCLASS_END // ----------------------------------------------------------------------------- @@ -924,7 +928,11 @@ PHP_PROTO_INIT_ENUMCLASS_START("Google\\Protobuf\\Field\\Kind", zend_declare_class_constant_long(field_kind_type, "TYPE_SINT64", 11, 18 TSRMLS_CC); const char *alias = "Google\\Protobuf\\Field_Kind"; +#if PHP_VERSION_ID < 70300 zend_register_class_alias_ex(alias, strlen(alias), field_kind_type TSRMLS_CC); +#else + zend_register_class_alias_ex(alias, strlen(alias), field_kind_type, 1); +#endif PHP_PROTO_INIT_ENUMCLASS_END // ----------------------------------------------------------------------------- |