Skip to content

Commit 797051d

Browse files
committed
Полиморфизм и инкапсуляция - сложные названия для простых вещей.
1 parent 92555d8 commit 797051d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

vendor/liw/core/App.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ public function __construct()
1010
{
1111
echo 'Создался новый экземпляр класса из папки "vendor/liw/core/"<br>';
1212
}
13+
14+
public function run()
15+
{
16+
echo 'Выполнился метод run родительского класса.';
17+
}
1318
}

web/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99

1010
// создали новый объект класса из папки vendor
1111
$app = new app\App();
12+
13+
// Имеем доступ к родительскому методу.
14+
$app->run(); // выполнит родительский метод run

0 commit comments

Comments
 (0)