Question: I have two functions inside a class called website. The two functions are checkStatus and killPage.

Function killPage is about using a nice simplistic styling instead of a complete word text hult.
Function checkStatus should use killPage inside the code, yet it won't let me use it.

Heres the code:

```
class website 
{
    function killPage($content)
    {
        die("

            <h1>" . Settings::WEBSITE_NAME ." encountered an error</h1>

            " . $content . "

            ");
    }

    function checkStatus(){
        if(Settings::STATUS == 'M')
        {

            $website->killPage('We are in maintence');
        }
        if(Settings::STATUS == 'O')
        {
        }
        if(Settings::STATUS == 'C')
        {
            $website->killPage('We are closed');
        }
    }
}

$website = new Website;

```

The error I get:

> 
> Undefined variable: website &&
>  Call to a member function killPage() on a
>  non-object
> 
> 
>

Answer: 
change `$website` to `$this`

```
class website 
{
    function killPage($content)
    {
        die("

            <h1>" . Settings::WEBSITE_NAME ." encountered an error</h1>

            " . $content . "

            ");
    }

    function checkStatus(){
        if(Settings::STATUS == 'M')
        {

            $this->killPage('We are in maintence');
        }
        if(Settings::STATUS == 'O')
        {
        }
        if(Settings::STATUS == 'C')
        {
            $this->killPage('We are closed');
        }
    }
}

```
The problem is here:

```
function checkStatus(){
    if(Settings::STATUS == 'M')
    {
        Settings::STATUS == 'M';
        $website->killPage('We are in maintence');
    }

```

You're dereferencing `$website` which has not been brought into scope.

In this case, `$website` is a global variable, you need to bring it into scope:

```
function checkStatus() {
    global $website;

    if(Settings::STATUS == 'M')

```

**EDIT** or as others pointed out, as `checkStatus` is a member function, you should use `$this`.