diff --git a/php/ext/google/protobuf/message.c b/php/ext/google/protobuf/message.c index 8b7d57ade5..2447268272 100644 --- a/php/ext/google/protobuf/message.c +++ b/php/ext/google/protobuf/message.c @@ -1131,7 +1131,7 @@ PHP_METHOD(Timestamp, fromDateTime) { } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetime, - date_interface_ce) == FAILURE) { + PHP_PROTO_CE_UNREF(date_interface_ce)) == FAILURE) { zend_error(E_USER_ERROR, "Expect DatetimeInterface."); return; }