Skip to content
Advertisement

Tag: psr-1

PHP | define() vs. const

In PHP, you can declare constants in two ways: With define keyword Using const keyword What are the main differences between those two? When and why should you use one and when use the other? Answer As of PHP 5.3 there are two ways to define constants: Either using the const keyword or using the define() function: The fundamental difference

Advertisement