this

<table border="1">
<tr onMouseOver="this.style.backgroundColor='#DBDDDE';" onMouseOut="this.style.backgroundColor='#0000ff';">
<td>ölkjöljk</td>
</tr>
</table>

ölkjöljk



$this refers to the class you are in.

Class Car {

function test() {
return "Test function called";
}

function another_test() {
echo $this->test(); // This will echo "Test function called";
}
}


<?php

class Person {
private $name;

public function __construct($name) {
$this->name = $name;
}

public function getName() {
return $this->name;
}

public function getTitle() {
return $this->getName()." the person";
}

public function sayHello() {
echo "Hello, I'm ".$this->getTitle()."<br/>";
}

public function sayGoodbye() {
echo "Goodbye from ".self::getTitle()."<br/>";
}
}

class Geek extends Person {
public function __construct($name) {
parent::__construct($name);
}

public function getTitle() {
return $this->getName()." the geek";
}
}

$geekObj = new Geek("Ludwig");
$geekObj->sayHello();
$geekObj->sayGoodbye();

?>

This will output:

Hello, I'm Ludwig the geek
Goodbye from Ludwig the person

Hello, I'm Ludwig the geek
Goodbye from Ludwig the person