<?php
class Telegram {
public $chat_id;
function __construct($a)
{
$this->chat_id = $a;
}
}
class DataBase extends Telegram {
function __construct()
{
print('constructed');
}
}
$a = new Telegram(3);
$b = new DataBase();
print($b->chat_id);
?>
class Telegram
{
public $chat_id;
public function __construct($a)
{
$this->chat_id = $a;
}
}
class DataBase extends Telegram
{
public function __construct($a)
{
parent::__construct($a);
print('constructed');
}
}
$a = new Telegram(3);
$b = new DataBase(123);
print($b->chat_id); // constructed123