Re: Re: Flexible type hinting
| From: | Paul Biggar | Date: | Thu, 02 Jul 2009 08:42:07 +0000 |
| Subject: | Re: Re: Flexible type hinting | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44626@lists.php.net to get a copy of this message | ||
On Thu, Jul 2, 2009 at 9:27 AM, Stanislav Malyshev<stas@zend.com> wrote:
> There is a functionality handling default values (or, more precisely,
> optional arguments) with inheritance, etc.
Are optional argument specifications inherited? I did not think they
were, but its not clear if you are saying they are.
My understanding of PHP's optional arguments is that they only apply
to a function once it is called.
> And it is doing something - if
> you declare interface as foo(int $a) and implement it as foo(string $a)
> there may be a lot of WTF happening.
I mean that it is never called, therefore the type hints are not
checked, and this is fine.
Paul
--
Paul Biggar
paul.biggar@gmail.com