Re: [PHP] calling parent class method from the outside

2007-07-03 Thread admin
Jochem Maas wrote: admin wrote: Jochem Maas wrote: ... the 'callback' type has a number of forms: 'myFunc' array('className', 'myMeth') array(self, 'myMeth') array(parent, 'myMeth') array($object, 'myMeth') self and parent adhere to the same 'context' rules when used in call_user_func*() a

Re: [PHP] calling parent class method from the outside

2007-07-03 Thread Jochem Maas
admin wrote: > Jochem Maas wrote: ... >> >> the 'callback' type has a number of forms: >> >> 'myFunc' >> array('className', 'myMeth') >> array(self, 'myMeth') >> array(parent, 'myMeth') >> array($object, 'myMeth') >> >> self and parent adhere to the same 'context' rules when used in >> call_user_

Re: [PHP] calling parent class method from the outside

2007-07-02 Thread admin
Jochem Maas wrote: admin wrote: Jochem Maas wrote: another solution for the OP might be (although I think it goes against all design principles): class A { function foo() { echo "achoo\n"; } } class B extends A { function foo() { echo "cough\n"; } function __call($meth, $arg

Re: [PHP] calling parent class method from the outside

2007-07-02 Thread Jochem Maas
admin wrote: > Jochem Maas wrote: >> another solution for the OP might be (although I think it goes against >> all >> design principles): >> >> class A { >> function foo() { >> echo "achoo\n"; >> } >> } >> >> class B extends A { >> function foo() { >> echo "cough\n"; >> } >> funct

Re: [PHP] calling parent class method from the outside

2007-07-02 Thread admin
Jochem Maas wrote: another solution for the OP might be (although I think it goes against all design principles): class A { function foo() { echo "achoo\n"; } } class B extends A { function foo() { echo "cough\n"; } function __call($meth, $args) { $func = array(parent, str

Re: [PHP] calling parent class method from the outside

2007-07-02 Thread Jochem Maas
Jim Lucas wrote: > admin wrote: >> Inside the body of method foo() you can of course use syntax like >> parent::foo(). But is there a way to call the parent version of >> obj->foo() outside the class? That kind of syntax is allowed in C++, for >> example: Aclass a; if (a.Aparent::foo()) ...; >> >>

Re: [PHP] calling parent class method from the outside

2007-07-02 Thread Jim Lucas
admin wrote: Inside the body of method foo() you can of course use syntax like parent::foo(). But is there a way to call the parent version of obj->foo() outside the class? That kind of syntax is allowed in C++, for example: Aclass a; if (a.Aparent::foo()) ...; Some contrived example to illustra

Re: [PHP] calling parent class method from the outside

2007-07-02 Thread Richard Heyes
admin wrote: Inside the body of method foo() you can of course use syntax like parent::foo(). But is there a way to call the parent version of obj->foo() outside the class? That kind of syntax is allowed in C++, for example: Aclass a; if (a.Aparent::foo()) ...; Not sure I get your requirement e

Re: [PHP] calling parent class method from the outside

2007-07-02 Thread Jochem Maas
admin wrote: > Inside the body of method foo() you can of course use syntax like > parent::foo(). But is there a way to call the parent version of > obj->foo() outside the class? That kind of syntax is allowed in C++, for > example: Aclass a; if (a.Aparent::foo()) ...; there is nothing in the lang