Re: [RFC] Deprecations for PHP 8.5

From: Date: Fri, 04 Jul 2025 22:20:57 +0000
Subject: Re: [RFC] Deprecations for PHP 8.5
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-127888@lists.php.net to get a copy of this message
On Fri, Jul 4, 2025 at 3:17 PM Ilija Tovilo <tovilo.ilija@gmail.com> wrote:

> Hi everyone
>
> On Wed, Jul 2, 2025 at 9:58 PM Gina P. Banyard <internals@gpb.moe> wrote:
> >
> > It is this time of year again where we proposed a list of deprecations
> to add in PHP 8.5:
> >
> > https://wiki.php.net/rfc/deprecations_php_8_5
>
> > Deprecate ReflectionClass::getConstant() for missing constants
>
> I don't have strong opinions on this change. However,
> ReflectionProperty::getDefaultValue() suffers from a very similar
> issue, except that it returns null rather than false
> (https://3v4l.org/G2R3l). It would make sense to avoid more
> inconsistencies. For example, ReflectionParameter::getDefaultValue()
> does throw if the parameter has no default value.
>
>

Good catch, I wasn't aware of this behavior for
ReflectionProperty::getDefaultValue(). I agree that we should avoid such
inconsistencies, and thus have proposed deprecating
ReflectionProperty::getDefaultValue() for properties that have no default
value. See
https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionpropertygetdefaultvalue_for_properties_without_default_values

-Daniel


Thread (73 messages)

« previous php.internals (#127888) next »