Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class A {
- private $val = 'a';
- public function test()
- {
- return $this->val;
- }
- }
- class B extends A {
- public $val = 'b';
- public function test()
- {
- return A::test();
- }
- }
- $b = new B();
- echo $b->test(); // output 'a'
Add Comment
Please, Sign In to add comment