Q:

Calling an overridden parent method

In the sample code below, the method test() in parent class Foo is overridden by the method test() in child class Bar.  Is it possible to call Foo::test() from Bar::test()?
class Foo 
{
  $text = "world\n";

  protected function test() {
    echo $this->text;
  }
}// class Foo

class Bar extends Foo 
{
  public function test() {
    echo "Hello, ";

    // Cannot use 'parent::test()' because, in this case,
    // Foo::test() requires object data from $this
    parent::test();
  }
}// class Bar extends Foo

$x = new Bar;
$x->test();

A:

Use parent:: before method name, e.g.
parent::test();

See parent

A:

parent::test();

(see Example #3 at http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php)

