What does "static::findOne($id)" mean?

Hi, When I study and try to use the


Interface yii\web\IdentityInterface

I found it use "static". What does it mean?




class User extends ActiveRecord implements IdentityInterface

{

  

public static function findIdentity($id)

    {

        return static::findOne($id);

    }

}



Does it equal to




public static function findIdentity($id)

    {

        return $this->findOne($id);

    }

}



?

It’s similar to self::

The difference between the 2 is that static:: references the class that was initially called at runtime instead of the one it resides in. For more information and examples, check out Late Static Bindings documentation.

And no, it’s not the same thing as $this. static refer to the class (not the instance of the class) and $this refer to the instance of the class (the instance of the class, in other words, the object).

Thanks! I kind of understand now.