Re: [PHP-DEV] [RFC] Deprecations for PHP 8.6
[email protected] (Bob Weinand)
| Newsgroups | php.internals |
|---|---|
| Message-ID | <[email protected]> |
Hey Volker, > Am 01.07.2026 um 15:32 schrieb Volker Dusch <[email protected]>: > > On Mon, Jun 22, 2026 at 6:44 PM Bob Weinand <[email protected]> wrote: > >> On "Deprecate changing by-reference return modifier via inheritance" - how exactly is this a LSP violation? If you assign a value without explicit "&" it'll be by-value, regardless of it being reference or not. If you put "&" there, you intentionally want a reference and you will get a warning when trying to use it. There's no magic "this value was a reference, hence this behaves differently now" in PHP, but references trivially decay to values, when used in a by-value context. >> This is basically covariance. There's no need to change this, and I assume there was a logic error from the author of that suggestion. > > Hi Bob, > > Sorry for the late reply. > > Thank you for the correction. Would you suggest I remove that sentence > from the proposal or that I retract the proposal? Given that it seems the whole argument in favour of that deprecation is flawed, I would suggest a complete retraction. Thanks, Bob