Re: [PHP-DEV] Make `always true` SPL methods return void

2020-06-20 Thread Johannes Schlüter
On Thu, 2020-06-18 at 23:17 -0400, Jesse Rushlow wrote: > * Disclaimer - I have not thoroughly reviewed the bug report or PR > mentioned. > > From a PHP developers perspective, if I was calling a method that > returned true. I would automatically assume that the method is > capable of returning

Re: [PHP-DEV] Make `always true` SPL methods return void

2020-06-19 Thread Marco Pivetta
Hey Dan, Gabriel, On Wed, Jun 17, 2020 at 12:17 PM Dan Ackroyd wrote: > On Wed, 17 Jun 2020 at 03:00, Gabriel Caruso > wrote: > > > > so changing it to `void` and > > just invoke these methods sounds reasonable to me. > > What's the benefit of doing the change? > > There will almost certainly

Re: [PHP-DEV] Make `always true` SPL methods return void

2020-06-18 Thread Jesse Rushlow
* Disclaimer - I have not thoroughly reviewed the bug report or PR mentioned. >From a PHP developers perspective, if I was calling a method that returned true. I would automatically assume that the method is capable of returning the inverse of that as well. I see Dan's point of "let sleeping dogs

Re: [PHP-DEV] Make `always true` SPL methods return void

2020-06-17 Thread Dan Ackroyd
On Wed, 17 Jun 2020 at 03:00, Gabriel Caruso wrote: > > so changing it to `void` and > just invoke these methods sounds reasonable to me. What's the benefit of doing the change? There will almost certainly be some code somewhere that would be broken by changing it, so it needs some benefit for

[PHP-DEV] Make `always true` SPL methods return void

2020-06-16 Thread Gabriel Caruso
Hello, internals, Inspired by the bug report #75958 (http://bugs.php.net/75958), I'd like to change the return type of some SPL methods that are always returning `true` and only `true`. These "always `true`" returns make no sense, as you can't wrap it in an `if`/`else` to catch something that