php Programming Glossary: mychildclass
What does new self(); mean in PHP? http://stackoverflow.com/questions/2396415/what-does-new-self-mean-in-php to get the singleton behavior class MyParentClass class MyChildClass extends MyParentClass public static function getInstance return.. public static function getInstance return new self a MyChildClass getInstance var_dump a Here you'll get object MyChildClass #1.. MyChildClass getInstance var_dump a Here you'll get object MyChildClass #1 0 Which means self means MyChildClass i.e. the class in which..
|