从嵌套类中访问类变量

My class structure is as follows,

Class Core{
      public $Variable = "Test";

      Class SubClass{
            // functions, etc

      }

      // functions etc
}

I need to access the variable $Variable from within the SubClass class, but I cannot think of a way to do it. I have tried $this->this->Variable without success.

Edit While this is incorrect syntax, this is how my class system is setup (and is achieved using includes).

Assuming you had a proper inheritance model set up, you could use parent::. But your code as-is is a flat-out syntax error. You cannot nest classes like that.

Class Core {
   public $var = 'test';
}

Class SubClass Extends Core {
   function foo() {
      $localvar = parent::$var;
   }
}

comment followup:

Perhaps something more like this?

class Core {
    public $Variable = 'foo';
    function __construct() {
       $this->subclass = new SubClass($this->variable);
    }
}

class SubClass {
    public $coreVariable;
    function __construct(&$var) {
       $this->coreVariable = $var;
    }
}

I am going to answer this because the previous comments show so much ignorance about how PHP works and the scope of variables when nesting Classes and functions which is perfectly fine to do in PHP. It happens a lot when using third party classes as includes in procedural code bases.

Class Core{
      public $Variable = "Test";

      Class SubClass{
            // functions, etc
            function new()
            {
               global $Variable;// this brings the variable into scope
               echo $Variable;
            {



      }

      // functions etc
}