aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/message.c
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:14:42 -0700
committerFeng Xiao <xfxyjwf@gmail.com>2018-08-08 17:14:42 -0700
commita8465b738e5a1f346ece58ea6f82612bcd6659d2 (patch)
treeb755540a5d7d2cc988eabc7ac594e6abd9da29d1 /php/ext/google/protobuf/message.c
parent6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (diff)
parent9bbc4b1fab8262958c172f2d8e87b486c950a051 (diff)
downloadprotobuf-a8465b738e5a1f346ece58ea6f82612bcd6659d2.tar.gz
protobuf-a8465b738e5a1f346ece58ea6f82612bcd6659d2.tar.bz2
protobuf-a8465b738e5a1f346ece58ea6f82612bcd6659d2.zip
Merge master branch.
Diffstat (limited to 'php/ext/google/protobuf/message.c')
-rw-r--r--php/ext/google/protobuf/message.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c
index 76d85ab0..0efe090d 100644
--- a/php/ext/google/protobuf/message.c
+++ b/php/ext/google/protobuf/message.c
@@ -223,13 +223,7 @@ static zval* message_get_property_ptr_ptr(zval* object, zval* member, int type,
}
static HashTable* message_get_properties(zval* object TSRMLS_DC) {
- // User cannot get property directly (e.g., $a = $m->a)
- zend_error(E_USER_ERROR, "Cannot access private properties.");
-#if PHP_MAJOR_VERSION < 7
- return zend_std_get_properties(object TSRMLS_CC);
-#else
- return zend_std_get_properties(object);
-#endif
+ return NULL;
}
static HashTable* message_get_gc(zval* object, CACHED_VALUE** table,
@@ -871,7 +865,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
// -----------------------------------------------------------------------------
@@ -926,7 +924,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
// -----------------------------------------------------------------------------