aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/message.c
diff options
context:
space:
mode:
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
// -----------------------------------------------------------------------------