Created
March 26, 2014 15:47
-
-
Save ovcharenkovv/9786422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Father { | |
private $fProperty; | |
public function setProp($fProperty) { | |
$this->fProperty = $fProperty; | |
return $this; | |
} | |
public function __construct() { | |
$this->setProp('parent'); | |
} | |
} | |
class Child extends Father { | |
public function __construct() { | |
parent::__construct(); | |
} | |
} | |
$father = new Father(); | |
var_dump($father); | |
$child = new Child(); | |
var_dump($child); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment