Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class class_one {
- protected $value;
- private $obj_two;
- public function __construct() {
- $this->obj_two = new class_two;
- }
- public function firstFunction() {
- $this->obj_two->obj_two_function();
- echo $this->value; // returns 'New Value' like set in the class two
- }
- }
- class class_two extends one {
- public function obj_two_function() {
- "class_one"->value = 'New Value';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement