RUVIDEO
Поделитесь видео 🙏

PHP Objects | Tutorial

📁 Обучение 👁️ 16 📅 01.12.2023

Course Title: Web Development Masterclass
Course Link: http://youaccel.com/admin/cdisplay.php?cid=11

Facebook: https://www.facebook.com/youaccel
Twitter: https://twitter.com/YouAccel
Website: http://youaccel.com

Tutorial Content:

An object data type stores data and also information on how to process the data known as a method.

As an example, a car could be considered an object. A car has certain properties such as make, model, color, weight, etc.

A method would be considered anything that the car can do, such as travel, turn, stop, or slow down.

As a rule an object must be explicitly declared.

The first step to creating an object, is to create a class. The class is the set of properties (or variables) that are tied to an object.

In this example, we have the class person. Next we've defined some properties that person has.

The person object, has three properties, a first name, a last name and age.

You will notice in front of each property we have an assignment, called public. There are three different types of assignments including, public, private and protected.

A public assignment means the property can be accessed everywhere.
A private assignment means it can only be accessed by the class that defines it.
A protected assignment means it can be accessed only within the class itself and by inherited parent classes.
Next we've constructed a function that tells our properties what values will be assigned to the variables, firstname, lastname and age.

In this case, each time a new person is created, the first value inside the parenthesis will be the objects firstname, the second value will be the last name, followed by age..

As a demonstration we have created two variables, person1 and person2. person1 creates a new person with the name John Smith, who is 25 years old.

person2 does the same with a different name and age.

We have a method inside our class. A method is a function tied to an object.

This method, which we have called hello, will output a sentence with the persons first name, last name and age.

We have called on this function at the end of our script. We can see the statement echo person1 hello. We also have echo person2 hello.

In our web browser we can see the values of the properties firstname, lastname and age have been outputted based on the number of new persons we created, which in this case is two.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «PHP Objects | Tutorial», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.