<?php
class parentt {
public $property1;
public function __construct()
{
$this->property1 = 1;
}
}
class child extends parentt {
public $property2;
public function __construct()
{
$this->property2 = $this->property1;
}
public function showProperty(){
return $this->property2;
}
}
$obj = new child();
echo $obj->showProperty();