return/parameter types for magic functions

From: Date: Thu, 28 May 2015 07:06:32 +0000
Subject: return/parameter types for magic functions
Groups: php.internals 
Request: Send a blank email to internals+get-86419@lists.php.net to get a copy of this message
Hi! Since we now allow defining return value types for functions, one can also create definition for magic functions that make no sense, such as __toString() : float or __isset() : Closure. I think we should restrict such definitions - either to types that makes sense or in case of methods that aren't supposed to return anything useful, completely. We already do this for ctors, dtors and __clone but not consistently for other magics. Also some values for parameter types make no sense. I've created a bug https://bugs.php.net/bug.php?id=69718 to track this. Not sure if this really needs an RFC. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#86419) next »