It’s a reference to the current object, it’s most commonly used in object oriented code.
- Reference: http://www.php.net/manual/en/language.oop5.basic.php
- Primer: http://www.phpro.org/tutorials/Object-Oriented-Programming-with-PHP.html
Example:
<?php
class Person {
public $name;
function __construct( $name ) {
$this->name = $name;
}
};
$jack = new Person('Jack');
echo $jack->name;
This stores the ‘Jack’ string as a property of the object created.