Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add void as a null type alias #8

Merged
merged 1 commit into from
Jul 17, 2015
Merged

Add void as a null type alias #8

merged 1 commit into from
Jul 17, 2015

Conversation

anlutro
Copy link
Contributor

@anlutro anlutro commented Jul 16, 2015

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

@DavidBadura
Copy link

void is not the same as null.

@anlutro
Copy link
Contributor Author

anlutro commented Jul 17, 2015

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
Copy link
Owner

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!

ircmaxell added a commit that referenced this pull request Jul 17, 2015
Add void as a null type alias
@ircmaxell ircmaxell merged commit 6404901 into ircmaxell:master Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants