⚙️
PHP Tools Hub
Tools
PHP
Quick
Contact
Home
>
Tutorials
>
PHP
>
PHP Constants
PHP Constants Tutorials
25 tutorials found.
📘
Check if Constant Exists
Checking Constants | defined Function | PHP
📘
const NAME = value
const Keyword | Syntax | PHP
📘
Constants Automatically Global
Scope | Global Scope | PHP
📘
Constants Don't Use $
Constants vs Variables | No $ Sign | PHP
📘
Current Line Number
Magic Constants | __LINE__ | PHP
📘
define('NAME'
define Function | Syntax | PHP
📘
UPPERCASE_WITH_UNDERSCORES
Naming Conventions | Uppercase | PHP
📘
Constants Accessible Inside Functions
Scope | Function Scope | PHP
📘
Constants Always Global
Constants vs Variables | Global by Default | PHP
📘
Current File Path
Magic Constants | __FILE__ | PHP
📘
Defined at Compile Time
const Keyword | Compile Time | PHP
📘
Get Constant Value
Checking Constants | constant Function | PHP
📘
No $ Prefix
Naming Conventions | No Dollar Sign | PHP
📘
Third Parameter Deprecated
define Function | Case Insensitive | PHP
📘
Constants Cannot Be Reassigned
Constants vs Variables | Cannot Change | PHP
📘
Current Directory Path
Magic Constants | __DIR__ | PHP
📘
Get All Defined Constants
Checking Constants | constants Function | PHP
📘
Only const in Classes
const Keyword | Class Constants | PHP
📘
Returns true on Success
define Function | Return Value | PHP
📘
Constants Support Limited Types
Constants vs Variables | Value Types | PHP
📘
Current Function Name
Magic Constants | __FUNCTION__ | PHP
📘
Current Class Name
Magic Constants | __CLASS__ | PHP
📘
Current Method Name
Magic Constants | __METHOD__ | PHP
📘
Current Namespace Name
Magic Constants | __NAMESPACE__ | PHP
📘
Current Trait Name
Magic Constants | __TRAIT__ | PHP