Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ParentClass {
- protected $foo = "bar";
- public function __construct()
- {
- $this->foo = "baz";
- }
- }
- class Child extends ParentClass {
- public function __construct()
- {
- //
- }
- public function getFoo()
- {
- return $this->foo;
- }
- }
- $child = new Child;
- // co bude zobrazeno na vypisu?
- echo $child->getFoo();
Advertisement
Add Comment
Please, Sign In to add comment