Re: [RFC] Void Return Type (v0.2, reöp ening)

From: Date: Thu, 15 Oct 2015 16:37:44 +0000
Subject: Re: [RFC] Void Return Type (v0.2, reöp ening)
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-88825@lists.php.net to get a copy of this message
Andrea Faulds wrote on 15/10/2015 17:34:
Hi Pedro, Pedro Cordeiro wrote:
I've been thinking about what PHP should do when accessing the return value of a void function, and so far, I think the consistent thing should be to get NULL, while throwing an E_NOTICE.
We could do this, but I do wonder if it might cause a lot of E_NOTICEs to pop up for existing code, assuming we applied this to built-in PHP functions. I'm not sure.
The way Pedro described it, it wouldn't apply to any existing functions because they wouldn't be declared void. Obviously, type hints for internal functions are a bit weird anyway, but there's no reason to assume that every function documented as void would suddenly be annotated in the Engine as such and start returning notices.

« previous php.internals (#88825) next »