RE: AW: [PHP-DEV] PDM Meeting Notes
| From: | Bob Silva | Date: | Wed, 23 Nov 2005 00:44:53 +0000 |
| Subject: | RE: AW: [PHP-DEV] PDM Meeting Notes | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20255@lists.php.net to get a copy of this message | ||
5.4 Late static binding using "this" without "$" (or perhaps with a
different name)
The same example, but now with the call to "self::static2()" replaced with
"static::static2()", will then print "B::static2".
Using static::func() is a bit corny, I understand why you don't want another
new keyword so here is a few more suggestions:
class::func()
default::func()
final::func()
I personally think the class:: would be a better solution than static::,
although this:: is the best solution, can I ask why that was ruled out since
the title of the section indicates it was the first preference.
Thanks
Bob Silva
> -----Original Message-----
> From: Marcus Boerger [mailto:helly@php.net]
> Sent: Tuesday, November 22, 2005 2:45 PM
> To: Matthias Pigulla
> Cc: internals
> Subject: Re: AW: [PHP-DEV] PDM Meeting Notes
>
> Hello Matthias,
>
> Tuesday, November 22, 2005, 9:22:16 PM, you wrote:
>
> >> 2.10 Dynamic class inheritance
>
> > Can someone elaborate a little on what this is supposed to be ;)?
>
> Binding static members at run time rather than compile time. See the notes
> for an example that shows the difference. Usage example again factories.
>
> >> 5.3 Implement inheritance rules for type hints
> >> Issue: Currently we don't check inheritance rules for type-hinted
> >> parameters.
>
> > Could someone please explain what exactly is/is not checked?
>
> From a typesystem point of view it would be perfectly leagal to change the
> typehint in a derived class as long as that respects is-a relation with
> the
> parent. Since the explanation is a bit complex, not what most people
> expect
> we live with the simple disagreement. And since most languages do not
> respect this correct or not at all anyway there is obviously no real
> common
> usecase for it. So PHP can live without that too (imo).
>
> Best regards,
> Marcus
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php