Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Magic Constants in PHP | Sehrli sabitlər PHP dilində | constants in double underscores

Автор: KODY•AZ

Загружено: 2025-09-07

Просмотров: 44

Описание:

PHP-də magic contants (sehrli sabitlər) xüsusi əvvəlcədən təyin olunmuş konstantlardır və istifadə olunduqları yerə görə fərqli məlumat qaytarırlar.
Onlar həmişə iki alt xətlə başlayır və bitir, məsələn _LINE__, __FILE_ və ya __CLASS__.
_LINE_ konstantı skriptdəki cari sətir nömrəsini göstərir.
_FILE_ faylın tam yolunu və adını verir, _DIR_ isə yalnız qovluq adını qaytarır.
Əgər funksiyanın içində istifadə olunarsa, _FUNCTION_ həmin funksiyanın adını göstərir.
Sinif daxilində istifadə edildikdə, _CLASS_ sinfin adını, _METHOD_ isə həm sinif, həm də metod adını birlikdə qaytarır.
Trait-lər üçün də xüsusi magic konstant var: __TRAIT__, hansı trait-dən istifadə olunduğunu göstərir.
Namespace ilə işləyən layihələrdə _NAMESPACE_ cari namespace-in adını bildirir.
Bu konstantlar debugging, loq yazmaq və kodun dəstəklənməsini asanlaşdırmaq üçün çox faydalıdır.
Magic konstantlardan istifadə etməklə proqramçılar kodda sabit yazılardan qaçaraq onu daha çevik və etibarlı edə bilirlər.

===

Magic constants in PHP are special predefined constants that return information about the code depending on where they are used.
They always start and end with double underscores, such as __LINE__, __FILE__, or __CLASS__.
The _LINE_ constant gives the current line number in the script.
With _FILE__, PHP returns the full path and name of the file, while __DIR_ shows only the directory.
If used inside a function, _FUNCTION_ provides the name of that function.
When used inside a class, _CLASS_ gives the class name, and _METHOD_ returns both the class and method name together.
Traits also have their own magic constant: __TRAIT__, which displays the trait name.
For projects that use namespaces, _NAMESPACE_ indicates the current namespace.
These constants are very useful for debugging, logging, and making code easier to maintain.
By relying on magic constants, developers can avoid hardcoding values and keep their code more flexible.

#kody_az #kodyaz #php #phpcode #laravel #phpprogramming #viral #viralcode #viralvideo #random #code #coder #azerbaycan #azerbaijan #baku #baki #programming #programmer #codes #hazırlıq #hazirliq #kurs #kurslar #course #courses #online #onlinecourses #test #quiz

Magic Constants in PHP | Sehrli sabitlər PHP dilində | constants in double underscores

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

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

Скачать аудио mp3

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

Autoload in PHP | Composer & PSR-4 | it's time to create a project | spl_autoload_register #kody_az

Autoload in PHP | Composer & PSR-4 | it's time to create a project | spl_autoload_register #kody_az

IDM в Smart Money. Идеальный сетап

IDM в Smart Money. Идеальный сетап

PHP başlanğıc ( PHP beginning ) #kody_az

PHP başlanğıc ( PHP beginning ) #kody_az

Clone in PHP | object cloning | shallow and deep cloning | copy of an existing object #kody_az

Clone in PHP | object cloning | shallow and deep cloning | copy of an existing object #kody_az

Promise in JavaScript | all any race | resolve & reject | pending fulfilled rejected #kody_az

Promise in JavaScript | all any race | resolve & reject | pending fulfilled rejected #kody_az

Что произошло с электронным реестром повесток? Иван Чувиляев

Что произошло с электронным реестром повесток? Иван Чувиляев

Kiber təhlükəsizlik dərs 1 - (Kiber təhlükəsizlik nədir?)

Kiber təhlükəsizlik dərs 1 - (Kiber təhlükəsizlik nədir?)

PHP

PHP

KODY.AZ Courses | Python & PHP | Fundamentals of Programming | Kurs barədə ətraflı video #kody_az

KODY.AZ Courses | Python & PHP | Fundamentals of Programming | Kurs barədə ətraflı video #kody_az

Где и как спасаться от мировой войны?

Где и как спасаться от мировой войны?

Fluent interface in PHP | chaining methods | zəncirvari axıcı interfeys | builder pattern #kody_az

Fluent interface in PHP | chaining methods | zəncirvari axıcı interfeys | builder pattern #kody_az

Как вылечить БЕЗ операций Близорукость,Дальнозоркость,Астигматизм,Косоглазие.Упражнения проф.Жданова

Как вылечить БЕЗ операций Близорукость,Дальнозоркость,Астигматизм,Косоглазие.Упражнения проф.Жданова

Зеленский на передовой. Захват Купянска оказался очередной ложью Путина

Зеленский на передовой. Захват Купянска оказался очередной ложью Путина

Мёрзнешь сам? Заморозь соседа!

Мёрзнешь сам? Заморозь соседа!

invoke in PHP | magic method __invoke() | object like a function | callable objects #kody_az

invoke in PHP | magic method __invoke() | object like a function | callable objects #kody_az

OOP Inheritance in JavaScript | extends & prototype & super | object create | ES5 and ES6 #kody_az

OOP Inheritance in JavaScript | extends & prototype & super | object create | ES5 and ES6 #kody_az

🔥БАКУ🔥РЫБНЫЙ РЫНОК КЕШЛЯ‼️ИКРА,БЕЛУГА,ОСЕТРИНА‼️ЦЕНЫ НА РЫБУ⁉️BALIQ BAZARI KEŞLƏ#baku#bazar#food#еда

🔥БАКУ🔥РЫБНЫЙ РЫНОК КЕШЛЯ‼️ИКРА,БЕЛУГА,ОСЕТРИНА‼️ЦЕНЫ НА РЫБУ⁉️BALIQ BAZARI KEŞLƏ#baku#bazar#food#еда

Komedixana  492-ci Bölüm  06.12.2025

Komedixana 492-ci Bölüm 06.12.2025

Şirin Serialı - 59. Bölüm (İkinci Mövsüm)

Şirin Serialı - 59. Bölüm (İkinci Mövsüm)

Misli Premyer Liqası 2025/2026 XV tur “Qarabağ” 5–1 “Araz-Naxçıvan”

Misli Premyer Liqası 2025/2026 XV tur “Qarabağ” 5–1 “Araz-Naxçıvan”

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



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