diff --git a/php/ext/google/protobuf/def.c b/php/ext/google/protobuf/def.c index 9accb1da3..6e1a7e4e4 100644 --- a/php/ext/google/protobuf/def.c +++ b/php/ext/google/protobuf/def.c @@ -916,7 +916,10 @@ static void add_descriptor(DescriptorPool *pool, if (upb_symtab_lookupfile2(pool->symtab, name.data, name.size)) { // Already added. - fprintf(stderr, "WARNING: file was already added\n"); + zend_error(E_USER_WARNING, + "proto descriptor was previously loaded (included in multiple " + "metadata bundles?): " UPB_STRVIEW_FORMAT, + UPB_STRVIEW_ARGS(name)); return; }