Interesting Fact about the ‘self’ keyword in PHP

Interesting Fact about the ‘self’ keyword in PHP

1naveengiri

15th May 2017

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 Reply

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