Using $this inside a static function fails

This is the correct way

public static function userNameAvailibility()
{
     $result = self::getsomthin();
}

Use self:: instead of $this-> for static methods.

See: PHP Static Methods Tutorial for more info 🙂

Leave a Comment