Den 2021-08-26 kl. 20:34, skrev Ben Ramsey:
Nikita Popov wrote on 8/26/21 09:57:
Right. I at least do not plan to address this issue. If you take a
protected property and publicly re-export it, then any compatibility issues
are on you.
This does not appear to affect only cases where one is re-exporting a
protected property as public.
Exception protected properties without type hints:
* PHP <= 8.0 - https://3v4l.org/GWmrk
* PHP 8.1 - https://3v4l.org/GWmrk/rfc
Exception protected properties with type hints:
* PHP <= 8.0 - https://3v4l.org/UX1Pa
* PHP 8.1 - https://3v4l.org/UX1Pa/rfc
Cheers,
Ben
So it looks like we have a bug here since the same code behaves
differently between 8.0 and 8.1.
I don't think it's obvoius that by adding a type hint we get
different behaviour for the "same" code in 8.0 vs 8.1.
The reason I brought this up is that in an Open source library
it's discussed how to solve this. Loading different versions of
the libray feels clunky.
r//Björn L
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php