Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |
rfc:allow-void-variance [2019/02/04 06:39] – wesnetmo | rfc:allow-void-variance [2019/02/04 07:48] (current) – wesnetmo |
---|
The ''method()'' can return anything, or nothing at all, but ''myFooConsumer'' just does not care about it. | The ''method()'' can return anything, or nothing at all, but ''myFooConsumer'' just does not care about it. |
| |
For this reason adding a type to ''void'' in subclasses is not an invalid operation, and denying it is a pointless restriction. Changing from ''void'' to something else is very probably a bad idea, but PHP should not enforce ''void'' in subclasses just on that basis. | For this reason adding a type to ''void'' in subclasses is not an invalid operation, and denying it is a pointless restriction. Changing from ''void'' to something else is probably a bad idea, but PHP should not enforce ''void'' in subclasses just on that basis. |
| |
===== Proposal ===== | ===== Proposal ===== |