Is the argument here that `void` is a supertype of everything?

@ellotheth Yeah, I don't get it ... :-( I I had a vote, I'd likely vote against that RFC. Seems unnecessary and confusing.

@ellotheth the argument is that because the original call returned nothing, nobody would be dumb enough to write:

if ($foo->returnsVoid()) { }

Therefore, returning anything won't break that code because nobody would be dumb to have written it in the first place!

Wow.

@dshafik @ellotheth I feel like this is a great opportunity to remind everyone that "nobody would ever do that!" in software means "someone is ready to do it as soon as you push that new version, and they are licking their chops and rubbing a fork and knife together right now. You can see them"

@level2wizard @dshafik It's like Rule 34 for software development.

THANKS I'LL BE HERE ALL WEEK

@ellotheth "Typescript does it" is not a good argument for something this bad

@ellotheth
> denies methods to be overridden with different types in subclasses

but that's a feature

that's how overriding works, unless you can also override with a function that takes different arguments

@trickster YES. This really nifty (and already accepted) RFC to apply Liskov substitution principles to the PHP type system is also worth reading just for the explanation of How It Should Work: wiki.php.net/rfc/covariant-ret

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!

We adhere to an adapted version of the TootCat Code of Conduct and follow the Toot Café list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators.

Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!