Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть PHP autoloading explained

  • PHP Explained
  • 2025-05-25
  • 112
PHP autoloading explained
  • ok logo

Скачать PHP autoloading explained бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно PHP autoloading explained или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку PHP autoloading explained бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео PHP autoloading explained

What is autoloading?
In a PHP project we might need to include multiple external files. Generally, we use include or require function to include these external files.

This is a tedious task to include hundred and thousand of external files like this.

Imagine we have a system that can include these external files in our current file automatically. Yes, it is possible. The system is called autoloading.


How to use autoloading?
When PHP parser has seen a class for the very first time, it includes the class into the current file using function spl_autoload_register().


Can we have an example, please?
Sure. Let's explain with an example.

At the top of our file we have used the function spl_autoload_register(). It contains an anonymous function as a parameter. Again that anonymous function contains a class name as a parameter. Finally, the same class name is included.
spl_autoload_register(function ($class_name) {
include $class_name . '.php';
});

Now, we are creating two objects of two different classes Test1 and Test2. See these two classes are not included manually anywhere. When PHP parser sees these functions for the first time, it checks whether spl_autoload_register function is available and it found. Then it included these two classes in the current file, provided the classes should be available within the project folder, anywhere.
$obj = new Test1();
$obj2 = new Test2();

So, the conclusion is, instead of including many files individually, PHP's autoloading features include all the files which are used in the current file using function spl_autoload_register().

Комментарии

Информация по комментариям в разработке

Похожие видео

  • File storage with AWS S3
    File storage with AWS S3
    19 часов назад
  • Google reCAPTCHA integration
    Google reCAPTCHA integration
    1 день назад
  • Sending SMS with Twilio & PHP
    Sending SMS with Twilio & PHP
    6 дней назад
  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]