I see you are trying to solve inconsistency, but i would do it opposite way. LSP errors should be warnings, they are not show stopper errors. It’s very much possible code violating LSP keeps working correctly. And in modern PHP development, everybody considers warnings as show stoppers anyway, so impact here is only in production. When some LSP breakage sneaks unnoticed into production and my INI settings just silence these and log them, I would prefer it to not crash there, because problem with these show only when expecting parent but receiving child, not when child breaks LSP but its nowhere used in place of parent.
And this RFC conveniently shows only big LSP violation examples like array -> int, but not widely used narrowing like mixed/object -> specific instance. > On 9. Apr 2019, at 10:25, Nikita Popov <nikita....@gmail.com> wrote: > > Hi internals, > > A small cleanup RFC for PHP 8: https://wiki.php.net/rfc/lsp_errors > > This makes all incompatible method signature (LSP) errors fatal, rather > than only warning in some cases. Especially after > https://wiki.php.net/rfc/parameter-no-type-variance I don't think there's > any reason to keep this backdoor in place. > > Regards, > Nikita -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php