I have a main php class such as this:
class MyClass { public $a; public $b; function __construct() { $this->a = new \SomeClass(); $this->b = 'some string'; } } is there a way the class which is stored in the $a (SomeClass) property can access the $b value which is actually a property which is stored in the class that initiated $a (MyClass) ?
$thisin the constructor or setting it after the object is created. You then would need to store MyClass as a property if you intend to use any where else in SomeClass after it is instantiated.