<?php class Test { public $var = 'test'; public function show_var() { echo $this->var; } } class Test_2 { protected $test; public function __construct() { $this->test = new Test; } public function show_test() { $this->test->show_var(); } } $test_2 = new Test_2; $test_2->show_test();
You have javascript disabled. You will not be able to edit any code.