Interesting Fact about the ‘self’ keyword in PHP

In PHP, you use the self keyword to access static properties and methods.

The problem is that you can replace $this->method() with self::method() anywhere, regardless if method() is declared static or not. So which one should you use?
check more on here

Leave a Comment

Your email address will not be published. Required fields are marked *