Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

This is my class:

Class RUNcookieDescutes Extends DF_CookiesDescutes
{

   function RUNcookieDescutes($Cookietype)
   {

      // parent the faiamal father object
      parent::$this->EachDescute = array("fsr" => array(0,1), // order by date                  
                                         "prf" => array(0,1,5,10,15), // refrech page url
                                         "ths" => array(0,1), // type of signature
                                         "tps" => array(10,30,50,70), // size of reply pages
                                         "por" => array(0,1), // order by reply or not
                                         "psa" => array(0,1,2), // find the display fined
                                         "pfr" => array("absulot")); // selected forums posts
      // parent the faiamal father object
      if ($Cookietype == 0)
      {
         parent::findElementsDescuteCookie();
      }
      else
      {
         parent::findElementsDescuteSession();
      }
   }

}

The error I receive is this:

Fatal error: Access to undeclared static property: DF_CookiesDescutes::$this in C:xampphtdocscp_incclass_object.php on line 441

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
322 views
Welcome To Ask or Share your Answers For Others

1 Answer

The error is:

Access to undeclared static property: DF_CookiesDescutes::$this

In your code:

parent::$this->EachDescute

You can't use this syntax. If you want get/set EachDescute class property you have to use:

$this->EachDescute;

If the EachDescute is set as private, you can't get/set it from extended class.

The keyword parent:: is used to call a method of parent class (in extended class).

You can't use parent:: keyword to set a property (variable).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...