Re: [VOTE] Void Return Type RFC

From: Date: Thu, 29 Oct 2015 13:03:03 +0000
Subject: Re: [VOTE] Void Return Type RFC
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-88995@lists.php.net to get a copy of this message
On 29 October 2015 at 12:48, Pedro Cordeiro <pedronaroga@gmail.com> wrote: > Like I said in a previous post, there is no need to forbid using a void > function return value. > > Throwing an E_NOTICE would be sufficient to inform the developer he's doing > something weird To me, that is not really different from forbidding it as it is good practice to turn all notices into errors, and it is not a good idea to blindly start suppressing errors. e.g. this code: $fn = getCallbackFunction(); logResult($fn()); would need error suppression as it's not possible to know whether the function is going to be 'void' or not. But that suppression could also hide actual errors. cheers Dan

« previous php.internals (#88995) next »