Tracking down the elusive "expecting T_PAAMAYIM_NEKUDOTAYIM"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux