Re: RE : [PHP-DEV] Return type hinting patch

From: Date: Wed, 30 Apr 2008 11:51:33 +0000
Subject: Re: RE : [PHP-DEV] Return type hinting patch
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-37350@lists.php.net to get a copy of this message
On Wed, 2008-04-30 at 12:58 +0200, LAUPRETRE François (P) wrote: > > From: Stanislav Malyshev [mailto:stas@zend.com] > > > First is that function > > definition and code is usually written by the same person in the same > > (very small) context, and this person has to be somewhat > > absent-minded > > to forget what function returns from definition to return a > > dozen lines > > below. Supporting such absent-mindedness with language constructs > > doesn't appear appropriate. > > Right, return type hinting is useless in such cases, but it is interesting when we check > whether a method is compatible with an implemented interface or an extended/abstract class. In this > case, both codes are typically not written by the same person and specifying the methods' > return types in an interface makes sense. This is my number one use, abstract methods that are later implemented. > Francois >

« previous php.internals (#37350) next »