PHP extension and E_USER_WARNING for deprecated methods

40 views
Skip to first unread message

Bartosz Tomczak

unread,
May 19, 2025, 6:25:48 AM May 19
to Protocol Buffers
Hi,

Recently there was a deprecation introduced in v31 in PHP

The deprecation itself has been set to trigger an error with 
zend_error(E_USER_WARNING,
             "getLabel is deprecated. Use isRequired or isRepeated instead.\n");

However, in PHP there is a dedicated error level E_USER_DEPRECATED as documented here .

My question is, was it intended to use E_USER_WARNING instead of E_USER_DEPRECATED? If no, what would be best way to make sure we use the latter from now on in future code updates?

The main issue I faced was that warning was automatically converted to exception by my PHP error handling logic (symfony framework in this case), however deprecations are just logged and the app can continue.

Thanks,
Bartosz

Em Rauch

unread,
May 19, 2025, 7:58:20 AM May 19
to Bartosz Tomczak, Protocol Buffers
Thank you for raising this; this appears to be an oversight which I can correct.

The change will go naturally with the PHP 4.32.0 release (=Q3); TBD if we decide to backport it for a PHP 4.31.1 point release if we do one.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com .
To view this discussion visit https://groups.google.com/d/msgid/protobuf/3bbc81ea-5453-4c0f-936e-7666157cc783n%40googlegroups.com .
Reply all
Reply to author
Forward
0 new messages