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_func*() as when you

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*()

[PHP] calling parent class method from the outside

2007-07-02 Thread admin
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 illustrate the point:

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 language

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

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

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()) ...; Some

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,

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; } function __call($meth, $args) {

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, $args)