Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-30 Thread David Duong
Stanislav Malyshev wrote: I think the only serious advantage I could see would be to allow context-assistance IDEs more data, so they could provide method-completion. PHPDoc does that with @return tag. True but there will be times when the documentation is wrong[1] or when the function retur

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-30 Thread David Duong
Stanislav Malyshev wrote: It would give you similar benefits to input type hinting, but instead of "Functions are now able to force parameters to be objects...", it would also read "Calling functions are now able to expect return types to be objects...". If a function was defined to return obje

RE: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-29 Thread Will Fitch
mentation to "promise" to implement certain methods? Will -Original Message- From: Stanislav Malyshev [mailto:[EMAIL PROTECTED] Sent: Sunday, July 29, 2007 3:07 AM To: Will Fitch Cc: 'Jeremy Privett'; 'Larry Garfield'; internals@lists.php.net Subject: Re: [PH

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-29 Thread Stanislav Malyshev
On one hand I agree, since PHP is so loosely typed. But it's hard to make the argument that type-hinting return values is pointless, since PHP allows (class) type-hinting with parameter values. I personally think type-hinting is very nice, and not for the purposes of IDEs. The difference is th

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-29 Thread Stanislav Malyshev
I think the only serious advantage I could see would be to allow context-assistance IDEs more data, so they could provide method-completion. PHPDoc does that with @return tag. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PRO

RE: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-28 Thread Will Fitch
6:05 PM To: internals@lists.php.net Subject: Re: [PHP-DEV] Re: Type-hinted return values in PHP5? On Saturday 28 July 2007, Stanislav Malyshev wrote: > > It would give you similar benefits to input type hinting, but instead of > > "Functions are now able to force parameters

RE: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-28 Thread Jeremy Privett
[PHP-DEV] Re: Type-hinted return values in PHP5? On Saturday 28 July 2007, Stanislav Malyshev wrote: > > It would give you similar benefits to input type hinting, but instead of > > "Functions are now able to force parameters to be objects...", it would > > also read &

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-28 Thread Larry Garfield
On Saturday 28 July 2007, Stanislav Malyshev wrote: > > It would give you similar benefits to input type hinting, but instead of > > "Functions are now able to force parameters to be objects...", it would > > also read "Calling functions are now able to expect return types to be > > objects...". If

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-28 Thread Stanislav Malyshev
It would give you similar benefits to input type hinting, but instead of "Functions are now able to force parameters to be objects...", it would also read "Calling functions are now able to expect return types to be objects...". If a function was defined to return object Z, but instead returned

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-27 Thread David Duong
It would give you similar benefits to input type hinting, but instead of "Functions are now able to force parameters to be objects...", it would also read "Calling functions are now able to expect return types to be objects...". If a function was defined to return object Z, but instead returned

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-19 Thread Stanislav Malyshev
It could be interesting to know, if the reason why this hasn't been implemented already, is technical one, or a design decision? I think it's design one since nobody took care to design it :) I personally don't see much need for it, since PHP is not a compiled language, so there's little use f

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-18 Thread Johannes Schlüter
On Wed, 2007-07-18 at 21:55 +0200, troels knak-nielsen wrote: > On 7/18/07, David Duong <[EMAIL PROTECTED]> wrote: > > Since there isn't any comments on this, should I have posted this > > elsewhere? or is it just that no one is interested? > > It could be interesting to know, if the reason why th

Re: [PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-18 Thread troels knak-nielsen
On 7/18/07, David Duong <[EMAIL PROTECTED]> wrote: Since there isn't any comments on this, should I have posted this elsewhere? or is it just that no one is interested? It could be interesting to know, if the reason why this hasn't been implemented already, is technical one, or a design decisio

[PHP-DEV] Re: Type-hinted return values in PHP5?

2007-07-18 Thread David Duong
Since there isn't any comments on this, should I have posted this elsewhere? or is it just that no one is interested? David Duong wrote: Hello everyone, I'm emailing to this list to suggest that "support for type-hinted return values"[1] be in added in PHP 5.y.x instead of PHP 6. Conceptuall