Re: [PHP] Calling parent function with call_user_func_array
- From: jochem@xxxxxxxxxxxxx (Jochem Maas)
- Date: Fri, 30 Nov 2007 00:06:27 +0100
Tommy Baggett wrote:
I'm a self-confessed PHP newb (first step towards a cure, right?), so
if these are your first steps why use php4? php5 has been out for
going on 3 years.
apologies in advance for what may be a basic question. I spent an hour
searching for an answer to this and couldn't find one.
I found one post that said there was a problem with this in 5.0.3, but
it didn't indicate whether the fix was also applied to the PHP4 branch.
I'm using PHP v4.4.7. I have class B which extends class A. I'm
overriding a function that is normally called with a variable number of
parameters via call_user_func_array. How do I call the class A
implementation of the function using call_user_func_array from the class
B implementation?
class A {
function doSomething($elements, $level) {
...
}
}
Class B extends A {
function doSomething($elements, $level) {
...
call_user_func_array(/*class A implementation of doSomething*/,
args);
does this work:?
call_user_func_array(array(parent,'doSomething'),$args);
it's an educated guess, no garantees.
}.
}
Thanks in advance for any help!
- Follow-Ups:
- RE: [PHP] Calling parent function with call_user_func_array
- From: "Tommy Baggett"
- RE: [PHP] Calling parent function with call_user_func_array
- References:
- Calling parent function with call_user_func_array
- From: "Tommy Baggett"
- Calling parent function with call_user_func_array
- Prev by Date: Re: [PHP] Batch process PDF files -- reduce color depth and resolution
- Next by Date: RE: [PHP] Calling parent function with call_user_func_array
- Previous by thread: Calling parent function with call_user_func_array
- Next by thread: RE: [PHP] Calling parent function with call_user_func_array
- Index(es):
Relevant Pages
|
|