Can this be used in php static methods?
Apr 25, 2020 pm 05:54 PMThis cannot be used in static methods
Static methods are loaded as the class is loaded, and static methods exist prior to objects. When we load a class, the object does not exist yet, and this represents a reference to the object. When we load the class, the object does not exist, so how can we use this? The answer is obvious
this refers to the current object. Static methods are methods called through classes and do not need to be instantiated. Since there is no need to instantiate, there is no current object. Since there is no current object, there will be no this
For more related knowledge, please pay attention to PHP Chinese website! !
The above is the detailed content of Can this be used in php static methods?. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
