Using $this, self::, parent:: for code readability

前端 未结 6 709
伪装坚强ぢ
伪装坚强ぢ 2021-02-08 13:51

I would like to know if it is acceptable/preferred to use self::method() and parent::method() when working in php classes.

You can use $this->method() but $this-> can al

6条回答
  •  暖寄归人
    2021-02-08 14:16

    I think self:: is used generally for static functions and properties.

    I use Kohana, and perhaps the controllers are made static.

提交回复
热议问题