Jump to content

Archived

This topic is now archived and is closed to further replies.

sneskid

'this->' vs 'self::'

Recommended Posts

i've read that using the self keyword can have a drawback when classes inherit other.
does using the 'this' keyword work around that?

what is the main difference between the 2.

thanks

Share this post


Link to post
Share on other sites
this-> is for class //calling the function, variable inside a class only.
while phpself //calling itself and not a class.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.