Re: late static binding php6
| From: | Jochem Maas | Date: | Mon, 19 Nov 2007 12:07:01 +0000 |
| Subject: | Re: late static binding php6 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33302@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
>> Rest assured that this is not the bad kind of 'more complex' I believe
>
> I'm afraid I must disagree. The feature that was missing was to know the
> true calling class name. That was implemented. You can build from it,
> there's no need to add further complication to the language. You can
> easily find out the calling class for static call, you can easily find
> it's parent, provided one exists, you can easily call any method of this
> class.
class A {
static function find($id) {
// lets try and find a 'something'
}
}
class B extends A {}
// I'd like a 'B' please bob.
$b = B::find( 1 );
are you saying that A::find() can tell that it was called as B::find() ?