PHP class directly call the static method does not perform initialization function
class Test{
protected static $a = 111;
public function __construct()
{
self::$a = 222;
}
public static function getA(){
echo self::$a;
}
}
Test::getA(); // 111
Program execution results: