89

php - define() vs const - Stack Overflow

 5 years ago
source link: https://stackoverflow.com/questions/2447791/define-vs-const/3193704#3193704
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Pretty straightforward question: In PHP, when do you use define('FOO', 1);and when do you useconst FOO = 1;What are the main differences between those two?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK