Re: [VOTE] Void Return Type RFC

From: Date: Thu, 29 Oct 2015 15:51:20 +0000
Subject: Re: [VOTE] Void Return Type RFC
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-89003@lists.php.net to get a copy of this message
Hi! > The use case is that it allows better static analysis Any analyzer worth its bytes would know whether the function returns non-null values (as opposed to whether you declared it to return it, the former being much more useful). However, more important point that I think introducing features into the language that solely useful as a help for (simplistic) static analyzers is not the right course. And, finally, I repeat my point - the errors of this class are so rare and obvious that I think we already spent more time on it than this feature would ever save. With static analyzers or without. I mean, if you've got function that never ever returns anything useful (that's the only kind you'd mark as void) why would you use it as an argument for another function? Why you would have no documentation and no tests that would make that fact immediately obvious? I remain unconvinced that this feature is of any considerable practical use. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#89003) next »