what's the difference?
Posted: Fri Jul 27, 2012 1:28 am
What's the different effect when accessing member using
and
Code: Select all
$this::doIt();
Code: Select all
$this->doIt();
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$this::doIt();
Code: Select all
$this->doIt();
Code: Select all
self::doIt();social_experiment wrote:First time i have seen this approach but i would say there's no difference
Yes.global_erp_solution wrote:does this mean I use :: only when referring to any static functions or members only?
Method: It's called statically (no $this) and you get a Strict "Non-static method Class::method() should not be called statically".global_erp_solution wrote:what's the side effect if I use :: to call instance member and functions?