Aliens School
Cinematic Knowledge Experience
0%
Aliens School
Now Playing
Aliens School · HIEN
⌨️ Keyboard Shortcuts
Next slide Previous slide SpacePlay / Pause MNarration on/off FFullscreen ?Show/hide this
Press any key to close
Skill Topic · Cinematic

PHP Magic Constants — Special Auto-Changing Constants

Version: v2.0.0 | Modified: 2026-03-25

Overview
🌟

PHP Magic Constants — Special Auto-Changing Constants — Quick Facts

📌

Magic Constant: Kya Return Karta Hai

🎯

`__LINE__`: Current line number

`__FILE__`: File ka full path

🔑

`__DIR__`: Directory ka path

Topic 1
📚

Magic Constants Kya Hain?

📚 Normal constants ki value fixed hoti hai — ek baar set, hamesha same. Lekin Magic…
Topic 2
💡 📊 🔬

`__LINE__` — Current Line Number

💡 Jis line par yeh likha hai, us line ka number return karta hai. Debugging me bahut useful…
Topic 3
🔒

`__FILE__` — Current File Path

🎯 Current file ka full absolute path return karta hai: `php <?php echo __FILE__; // Output:…
Topic 4

`__DIR__` — Current Directory

Current file ki directory ka path return karta hai. Yeh dirname(__FILE__) ka shortcut…
Topic 5
📥 📥 🧠 🔬 💡 🎯

`__FUNCTION__` — Current Function Name

🔑 Jis function ke andar yeh likha hai, us function ka naam return karta hai: `php <?php…
Topic 6
📊 🔬

`__CLASS__` — Current Class Name

Jis class ke andar yeh likha hai, us class ka naam return karta hai: `php <?php class…
Topic 7
📥 ⚙️ 🔬 💡

`__METHOD__` — Current Method (Class::method)

🌟 __FUNCTION__ sirf function ka naam deta hai, lekin __METHOD__ class ka naam bhi saath me…
Topic 8
🚀

`__NAMESPACE__` — Current Namespace

🚀 Current namespace ka naam return karta hai. Agar koi namespace defined nahi hai to empty…
Topic 9
📥 📥 🧠 🔬 💡 🎯

`__TRAIT__` — Current Trait Name

📚 Jis trait ke andar yeh likha hai, us trait ka naam return karta hai: `php <?php trait…
Topic 10
💡 📊 🔬

`ClassName::class` — Full Qualified Class Name

💡 Class ka poora naam with namespace return karta hai. Yeh technically magic constant nahi…
Topic 11
📥 ⚙️ 🔬 💡

Complete Reference Table

🎯 | Magic Constant | Kya Return Karta Hai | Example Output |…
Topic 12

Practical Example: Debug Logger

`php <?php class Logger { public static function debug($message, $file = null, $line =…
Topic 13
📥 📥 🧠 🔬 💡 🎯

Summary

🔑 | Point | Detail | |-------|--------| | Pehchaan | Dono taraf double underscores __NAME__…
Quick Quiz
🧠 QUIZ TIME

Quiz — Question 1

PHP Magic Constants — Special Auto-Changing Constants ka sabse sahi definition kya hai?

Quick Quiz
🧠 QUIZ TIME

Quiz — Question 2

PHP Magic Constants — Special Auto-Changing Constants ka '__LINE__' kya hai?

Complete! 🎉
COMPLETE

PHP Magic Constants — Special Auto-Changing Constants Complete!

Aliens School · HIEN · Cinematic Knowledge

PHP Magic Constants — Special Auto-Changing Constants Complete

1/18
0:00
REC 00:00ESC=Cancel
Aliens School
3
Recording shuru hone wali hai...
Recording Complete
Video process ho rahi hai...
Live Class
Slide 1 / 7
Timer
00:00
📝 Speaker Notes
⏭️ Up Next
🗂️ All Slides