Closed anlutro closed 9 years ago
void is not the same as null.
In other programming languages, and in programming theory, I think that is correct... but in a practical sense, in PHP, there is no difference between return null;
, return;
and a function without a return statement, so I think it makes sense for a parser to treat it as null.
I'm debating adding VOID as a distinct type from null (though in practice they are the same, for analysis purposes it can be useful to distinguish them). In the mean time it's useful to not treat it like a class. So Thanks!
Whether using "void" is a good practice could probably be argued, but it is pretty common in my experience.