Magic Constants - PHP - P71

Опубликовано: 24 Октябрь 2024
на канале: Dino Cajic
704
16

We'll be exploring PHP's Magic Constants.

__LINE__, which displays the current line number of the file.
_FILE_ , which displays the full path and filename of the file
__DIR__, which displays the directory of the file.
__FUNCTION__, which displays the function name, or {closure} for anonymous functions.
__CLASS__, which displays the class name. The class name includes the namespace it was declared in.
__TRAIT__, which displays the trait name. The trait name includes the namespace it was declared in.
__METHOD__, which displays the class method name.
__NAMESPACE__, which displays the name of the current namespace.

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

Code for this tutorial
https://github.com/dinocajic/php-7-yo...

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

PHP Playlist
   • PHP Tutorial  

--
Dino Cajic
Author and Head of IT

Homepage: https://www.dinocajic.com
GitHub: https://github.com/dinocajic
Medium:   / dinocajic  
Instagram:   / think.dino  
LinkedIn:   / dinocajic  
Twitter:   / 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