glenelkins Posted April 29, 2009 Share Posted April 29, 2009 Hi Bit lost on this one, say i have the following 3 classes: class Test1 { var $test2; var $test3; var $test_string = 'HELLO WORLD'; function Test1() { $this->test2 =& new Test2(); $this->test3 =& new Test3; } } class Test2 { function Test2() { // want to echo $test_string from Test1() } } class Test3 { } How can i make it so the Test2 object can access the $test_string from the Test1 class?? Or better explained still, i want to access the Test2 object from the Test3 class ?? Link to comment https://forums.phpfreaks.com/topic/156106-solved-class-scope-question/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.