Is ist possible, to overwrite a function in PHP by calling the parent
function that has the same name?
I have a classA and a classB with a method funcDisplay():
----------------------------------
classA {
function funcDisplay()
{
print "line 1A";
print "line 2A";
}
}
-----------------------------------
classB extends classA
{
functionm funcDisplay
{
$this->funcDisplay();
// should call the func of the parent class!
print "line 1B";
print "line 2B";
}
}
When I test this, I get an memory failure and a fatal error message from
windows. I think $this->funcDisplay is an endless loop by calling
itself. But how can I tell this the PHP compiler to use the upper class?
I want to call from funcDisplay() from classB the funcDisplay() in
classA, that I get the inherited function of the parent class like the
following result:
----
line 1A
line 2A
line 1B
line 1B
----
I thank you in advance,
Lars