I have a class that is throwing the error:
syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM ...

It is appearing in the constructor of a parent class

abstract class parent
{
  protected $titles = array('title1','title2','title3');
  protected $a;
        
  function  __construct($set  =  NULL,  $special  =  NULL)
  {
self::$this->titles = array_merge(self::$this->titles, $special); //error

    foreach($set  as  $key=>value)
    {
      if  (array_key_exists($key,$this->titles)
      {
        $this->a[$key]  =  $value;
      }
    }
  }
}

class child extends parent
{
  protected $titles = array('titleA', 'titleB', 'titleC');

  function __construct($set, $special = NULL)
  {
    self::$this->titles = array_merge(self::$this->titles, $special);
    parent::__construct($set, self::$this->titles);
    unset($this->titles);
  }
}

Basically parent is an extensible tool for holding data with titles that dictate behavior later in the script. Eventually I will have a dozen or so different child classes each using an identical API. But first I need this constructor to work. The parent constructor just tacks the array of titles from the $special attributes onto the end of the $titles array.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to