Skip to content

Instantly share code, notes, and snippets.

@ovcharenkovv
Created March 26, 2014 15:47
Show Gist options
  • Save ovcharenkovv/9786422 to your computer and use it in GitHub Desktop.
Save ovcharenkovv/9786422 to your computer and use it in GitHub Desktop.
<?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