With the new static keyword in PHP 5, is there any reason to use self keyword? I don't see any use-cases for it anymore
Asked
Active
Viewed 117 times
3 Answers
3
self
and static
mean two different things. See the documentation on late static binding. The first two examples demonstrate the difference.

Michael Mior
- 28,107
- 9
- 89
- 113
2
In the context of static method if you wish to call another static method - you use self::anotherStaticMethod()

zerkms
- 249,484
- 69
- 436
- 539
0
It is for static
class members (access staic things in the same class) - that do not have a $this
.

Ed Heal
- 59,252
- 17
- 87
- 127