<?php class Foo { private $x = 1; public function check() { return $this->x; } } class Bar extends Foo { public $x = 2; } class Buz extends Foo { private $x = 3; public function check() { return $this->x; } } $n = new Bar; var_dump($n); $k = new Buz; var_dump($n->check()); var_dump($k->check());
You have javascript disabled. You will not be able to edit any code.