Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-11 Thread Sebastian Bergmann
Am 09.04.2019 um 10:25 schrieb Nikita Popov: A small cleanup RFC for PHP 8: https://wik +1 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-10 Thread Theodore Brown
On Wed, April 10, 2019 at 10:06 AM Gabriel O wrote: > On 10 April 2019 4:48:38 PM Theodore Brown wrote: > > > > I for one would welcome consistent fatal errors for LSP violations, > > to catch these kind of bugs as early as possible during development. > > Once again, nowadays warnings are conve

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-10 Thread Theodore Brown
On Tue, Apr 9, 2019 at 11:05 AM Gabriel O wrote: >> On 9. Apr 2019, at 17:35, Levi Morrison wrote: >> >> If you want the reverse to be true, then your code has bugs waiting to >> show themselves. The earlier we can catch these bugs, the better. >> >> One thing to note is that return type informa

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-09 Thread Gabriel O
> If you want the reverse to be true, then your code has bugs waiting to > show themselves I don’t, I just don’t want fatal errors in production when I upgrade library I extend. Let me keep logging such issues and fix them later, instead of producing hard crash for customers. > The earlier

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-09 Thread Levi Morrison
On Tue, Apr 9, 2019 at 9:00 AM Gabriel O wrote: > > I believe rfc deals with reverse situation > > On 9 April 2019 4:47:50 PM Dan Ackroyd wrote: > > > On Tue, 9 Apr 2019 at 11:58, Gabriel O wrote: > > > >> And this RFC conveniently shows only big LSP violation examples like array > >> -> int, bu

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-09 Thread Gabriel O
I believe rfc deals with reverse situation On 9 April 2019 4:47:50 PM Dan Ackroyd wrote: On Tue, 9 Apr 2019 at 11:58, Gabriel O wrote: And this RFC conveniently shows only big LSP violation examples like array -> int, but not widely used narrowing like mixed/object -> specific instance.

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-09 Thread Dan Ackroyd
On Tue, 9 Apr 2019 at 11:58, Gabriel O wrote: > And this RFC conveniently shows only big LSP violation examples like array -> > int, but not widely used narrowing like mixed/object -> specific instance. Type narrowing or contravariant parameters is properly supported for PHP 7.4: https://wiki.

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-09 Thread Gabriel O
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, s

Re: [PHP-DEV] [RFC] Always generate fatal error for incompatible method signatures

2019-04-09 Thread Bishop Bettini
On Tue, Apr 9, 2019 at 4:25 AM Nikita Popov 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/para