Hello,
I am trying to extend a class from the package Math_Finace in PEAR.
As a trial the only thing I am doing is to write the extended class like this:
class Math_Finance_Inher extends Math_Finance {
function newPresentValue() {
return "A string";
}
}
in a separate file under the file where is the base class.
Afterwards, I create a object:
$var = new Math_Finance_Inher();
and I tried to get the value of newPresentValue();
echo $var -> newPresentValue();
but nothing is returned, though there are not errors either.
Am I missing something?
Thank you.
Extension of PEAR classes.
Moderator: General Moderators
Re: Extension of PEAR classes.
There's something else going wrong.
1. Are you sure you have display_errors=on and error_reporting=-1? If not then you might not see all the errors.
2. Is your script crashing? Perhaps because it can't find the class?
3. Are you missing silly little things like <?php tags?
1. Are you sure you have display_errors=on and error_reporting=-1? If not then you might not see all the errors.
2. Is your script crashing? Perhaps because it can't find the class?
3. Are you missing silly little things like <?php tags?
-
cortazar11
- Forum Newbie
- Posts: 10
- Joined: Mon Nov 14, 2011 1:48 pm
Re: Extension of PEAR classes.
Thank you for the answer.
That is right. I didn't put on the display_errors.
The error is that the base class is not found.
I sorted. As the inherited class was in different file, I needed to call that first through the require command.
Thank you.
That is right. I didn't put on the display_errors.
The error is that the base class is not found.
I sorted. As the inherited class was in different file, I needed to call that first through the require command.
Thank you.