$ This-> $ function () in PHP what does it mean? How can this problem be solved?

Source: Internet
Author: User
$ This-& gt; $ function () in PHP? Dear friends, recently, my younger brother is reading the code of daily group buying. The result is in modulesindex. mod. php shows the following code: PHPcodefunctionModuleObject ($ config) {$ this-& gt; MasterObject ($ config); $ this-> $ function () what does it mean in PHP?
Dear friends, recently, my younger brother is reading the code of group buying every day. The result shows this code in/modules/index. mod. php:
PHP code
  function ModuleObject( $config )    {        $this->MasterObject($config);        $runCode = Load::moduleCode($this);        $this->$runCode();    }

In the fifth line of code, $ this-> $ runCode (); does this sentence have any special meaning in PHP? I am not trained in PHP, so I don't understand some basic rules that are not commonly used. I hope you will be grateful for your guidance.

------ Solution --------------------
Manual cloud:

Variable functions
PHP supports the concept of variable functions. This means that if a variable name has parentheses, PHP will look for a function with the same name as the value of the variable and will try to execute it.

------ Solution --------------------
$ This-> $ runCode ();
This must be in your class.
------ Solution --------------------
Class ModuleObject extends MasterObject
Go to his parent class and public class to search
Go to the configuration file config. php (usually called this) and check the introduced class file.
------ Solution --------------------
$ RunCode = Load: moduleCode ($ this );
$ This-> $ runCode ();
Does the $ runCode in the second line have a relationship with the $ runCode in the first line?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.