read_property() handler is not supposed to return NULL NULL is never expected as a result of read_property() handler, it should return &EG(uninitialized_zval) if there is no such property in the object
diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index 7f27670..0f1f4c9 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c
@@ -334,7 +334,7 @@ Message* intern = PROTO_VAL_P(obj); const upb_fielddef *f = get_field(intern, member); - if (!f) return NULL; + if (!f) return &EG(uninitialized_zval); Message_get(intern, f, rv); return rv; }