ircmaxell / Tuli

A static analysis engine
MIT License
169 stars 7 forks source link

Add void as a null type alias #8

Closed anlutro closed 9 years ago

anlutro commented 9 years ago

Whether using "void" is a good practice could probably be argued, but it is pretty common in my experience.

DavidBadura commented 9 years ago

void is not the same as null.

anlutro commented 9 years ago

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.

ircmaxell commented 9 years ago

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!