Re: Asymmetric visibility is a BC break

From: Date: Thu, 10 Oct 2024 13:32:38 +0000
Subject: Re: Asymmetric visibility is a BC break
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-125779@lists.php.net to get a copy of this message
On 09.102024 at 19:20 Claude Pache <claude.pache@gmail.com> wrote: > There is no BC break, in the sense that code that worked under PHP 8.3 (and therefore use PHP > 8.3 features only) will not break when run under PHP 8..4. > > Of course, code that makes assumptions that are true when using PHP 8.3 features only, will > need to be adapted as soon as PHP 8.4 features are used. This is unsurprising and expected. Hi, Claude! Thank you for the explanation. I now get why aviz does not break BC :) Until now, I was worried that we were missing something important. > That said, https://github.com/php/php-src/pull/16209 is > interesting to have, but not mandatory. The current > ReflectionProperty::isPropertySet() and > ReflectionProperty::isPrivateSet() might be somewhat confusing at > first, but they are sufficient in order to obtain the needed information. Yes, they are sufficient, but very difficult to work with. Just to check that property is writable from global scope, you have to do `isPublic() && !isReadonly() && !isPrivateSet() && !isProtectedSet() && (!isVirtual() || hasHook(PropertyHookType::Set))`. See our discussion with Ilija: https://github.com/php/php-src/issues/16175#issuecomment-2389966021 -- Valentin

« previous php.internals (#125779) next »