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

Visibility Modifiers - PHP - P51 смотреть онлайн

I know that I've mentioned visibility in the past few tutorials that we covered on object oriented programming. The time has finally come to see what it means. If you look at the classes that we've been creating so far, each property and method had the public visibility modifier attached to it. That means that everyone has access to it. The default visibility modifier is also public, so if we were to create any of the properties or functions and we omitted the "public" visibility modifier, it would have automatically defaulted to it. I like to place them in front to be explicit.

We're going to be modifying the classes in this tutorial to change the visibility of most, if not all properties from public to private. Private visibility means that the method or property can only be accessed from within the class. So if we instantiate the class and try to access the property with the aid of the object operator, we will get an error. Methods inside the class will have the capability of accessing the private properties.

There is one last visibility modifier, and even though I'll briefly talk about it, we still need a couple of more tutorials to fully appreciate it. That is the protected visibility modifier. It acts like a private modifier in the sense that you can't access it outside of the class. So if we instantiate the class and use the object operator, we will not be able to use it. However, classes that inherit from the class containing the protected modifier will have access to it.

We're going to be modifying our German Shepherd class to follow some simple inheritance. We'll create a new class called Dog, and the German Shepherd class will inherit properties from the Dog class. The properties in the Dog class will be protected, so they'll only be usable inside the German Shepherd class.

In this tutorial, we're only going to look at the private properties and will come back to the protected properties shortly.

Read the full article on my website
https://www.dinocajic.com/php-visibility-modifiers/

Code for this tutorial
https://github.com/dinocajic/php-7-youtube-tutorials/blob/master/51%20Visibility.php

Full Code
https://github.com/dinocajic/php-7-youtube-tutorials

PHP Playlist
https://www.youtube.com/playlist?list=PLbhJy0VhR6SAmoneYvF6Y_axQJKg7i50M

--
Dino Cajic
Author and Head of IT

Homepage: https://www.dinocajic.com
GitHub: https://github.com/dinocajic
Medium: https://medium.com/@dinocajic
Instagram: https://www.instagram.com/think.dino
LinkedIn: https://www.linkedin.com/in/dinocajic/
Twitter: https://twitter.com/dino_cajic

My Books
An Illustrative Introduction to Algorithms
https://www.amazon.com/dp/1686863268

Laravel Excel: Using Laravel to Import Data
https://amzn.to/4925ylw

Code Along With Me - PHP: From Basic to Advanced PHP Techniques
https://amzn.to/3M6tlGN

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

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

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

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