Skip to content

Commit 5482336

Browse files
committed
Что такое класс. Создание объекта класса.
1 parent 4372f0c commit 5482336

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

web/index.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
<?php
22

3-
echo 'Привет! Если ты видишь в браузере это сообщение,<br>
4-
значит сервер настроен правильно и можно приступать к занятиям!';
3+
class Room
4+
{
5+
private $color = 'red';
6+
7+
public function changeColor($color)
8+
{
9+
$this->color = $color;
10+
}
11+
12+
public function getColor()
13+
{
14+
return $this->color;
15+
}
16+
}

0 commit comments

Comments
 (0)