I don't agree as I don't think static methods should be virtual. This is
what $this-> exists for. Re-design...!
Andi
At 03:11 PM 6/1/2004 +0200, Bert Slagter wrote:
Hi All,
I have a class and a subclass, both with a static method:
class Foo2 extends Foo
{
static function Baz()
{
>;
<[EMAIL PROTECTED]>
Sent: Wednesday, June 02, 2004 12:26 PM
Subject: Re: [PHP-DEV] Use of 'self' in static function in subclass
> On Tue, 2004-06-01 at 19:53, Hans Lellelid wrote:
> > Yeah +1 on self:: binding at runtime. I can't really imagine a case
> > whe
On Tue, 2004-06-01 at 19:53, Hans Lellelid wrote:
> Yeah +1 on self:: binding at runtime. I can't really imagine a case
> where you would want to refer to 'self' as the class that contains the
> method *and not* the overridden method in invoked class (if it exists).
> Binding this at runtime
Ferdinand Beyer wrote:
On 1 Jun 2004 at 21:13, Timm Friebe wrote:
Yes: self is bound at compiletime. It would need to be changed to
evaluation at runtime und would be far more useful then.
[...]
I wouldn't mind chaning self in the first place, though.
I prefer your solution to evaluate self at ru
On 1 Jun 2004 at 21:13, Timm Friebe wrote:
> Yes: self is bound at compiletime. It would need to be changed to
> evaluation at runtime und would be far more useful then.
>
> [...]
>
> I wouldn't mind chaning self in the first place, though.
I prefer your solution to evaluate self at runtime ins
On Tue, 2004-06-01 at 15:11, Bert Slagter wrote:
> Hi All,
>
> I have a class and a subclass, both with a static method:
[...]
> Somehow this behaviour seems logical, on the other hand I don't think
> it's desired. I think that 'self' should point to the current class,
> even if the static metho
On 1 Jun 2004 at 16:19, Bert Slagter wrote:
> This is a minimal testcase, in my real life situation there indeed is a
> 'abstract static function Baz();' in Class Foo. But indeed, then a
> "Fatal error: Cannot call abstract method Foo::Baz() in.." arises..
OK, this is indeed a problem then.
-
Ferdinand Beyer wrote:
He should define an abstract method Foo::Baz() here.
This is a minimal testcase, in my real life situation there indeed is a
'abstract static function Baz();' in Class Foo. But indeed, then a
"Fatal error: Cannot call abstract method Foo::Baz() in.." arises..
Bert
--
PHP I
Ferdinand Beyer wrote:
On 1 Jun 2004 at 15:21, Stephan Schmidt wrote:
Furthermore this renders the template-method pattern quite
useless, so
IMHO it should be changed.
He should define an abstract method Foo::Baz() here.
Yes, I agree that design-wise that would be better -- but it will still
fa
On 1 Jun 2004 at 15:21, Stephan Schmidt wrote:
> Furthermore this renders the template-method pattern quite
useless, so
> IMHO it should be changed.
He should define an abstract method Foo::Baz() here.
--
Ferdinand Beyer
<[EMAIL PROTECTED]>
--
PHP Internals - PHP Runtime Development Mailing
Hi,
> Somehow this behaviour seems logical, on the other hand I don't think
> it's desired. I think that 'self' should point to the current class,
> even if the static method resides in a parent class.
>
> Is this 'self'-behaviour intended?
Furthermore this renders the template-method pattern
11 matches
Mail list logo