When to use self vs $this?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jangmi
Forum Newbie
Posts: 11
Joined: Sat Mar 08, 2014 7:39 am

When to use self vs $this?

Post by jangmi »

In PHP 5, what is the difference between using self and

Code: Select all

$this?
When is each appropriate?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: When to use self vs $this?

Post by Celauran »

Post Reply