I was testing return types with PHP 7.
I\'ve created a simple script to test return types of PHP 7:
@BeNice I understand your point, anyhow I summarize the consideration from
Levi Morrison as a practical question of sustainability: introducing void as a possible return type infact, we break the assumption that the only possible type of null is null.
This way, void should be returned for the type check of null, changing architecture constraints by design and causing a mess in backward compatibility.
// your choice implies this comparison should be true:
gettype(null) === void;
I think who used null not frequently in his code would bear the void type implementation.