About the usage of self and this parent keywords in php

$this //represents this object

self //represents this class

parent //represents the parent class

$this-> Access instantiated methods and properties in the class self::Access static methods and properties
in the class itself * public static function fun(){} parent::Used to access the parent when the current class is a subclass Static methods and property magic methods of objects



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324808365&siteId=291194637