When would you use the $this
keyword in PHP? From what I understand $this
refers to the object created without knowing the objects name.
Al
A class may contain its own constants, variables (called "properties"), and functions (called "methods").
var;
}
}
?>
Some examples of the $this pseudo-variable:
foo();
// Note: the next line will issue a warning if E_STRICT is enabled.
A::foo();
$b = new B();
$b->bar();
// Note: the next line will issue a warning if E_STRICT is enabled.
B::bar();
?>
The above example will output: