Q:

extending a class with special overload

I what to basically extend a class and overload a function while still calling the original function in the overloaded function. Let me post me code first before I further explain.
class specList
{
    public function __construct()
    {
         $this->list = array();
    }

    public function add($item)
    {
        $this->list[] = $item;
    }

    public function display()
    {
         /*  
          *  for simplicity sake lets assume I have a function ul($list) that 
          *  builds a properly formatted <ul> with each item contained in a <li>.
          */
         return ul($this->list);
    }
}

class wrappedList extends specList
{
    public function __construct()
    {
        parent::__construct();
    }

    public function display()
    {
        $return = '<div class="panel">';
        $return .= //I need some way to call the parents display() function
        return $return.'</div>';
    }
}

I know this seems a really complex way of adding such a simple feature. This is a watered down version of my code to provide a simple example to explain my problem. I need to be able to use the same name to overload to function but add a beginning and end set of code to the extended class. Is there anyway to accomplish this? I don't know where else to start.

A:

Use parent::display(). See the php manual.
For example:
class wrappedList extends specList
{
    public function __construct()
    {
        parent::__construct();
    }

    public function display()
    {
        $return = '<div class="panel">';
        $return .= parent::display();
        return $return.'</div>';
    }
}

