What is the difference between define and const in php? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between define and const in php?

23rd Apr 2017, 7:13 PM
Muhammad Saimon Uddin
Muhammad Saimon Uddin - avatar
2 Answers
+ 2
"The fundamental difference between those two ways is that const defines constants at compile time, whereas define defines them at run time." source: http://stackoverflow.com/questions/2447791/define-vs-const
23rd Apr 2017, 8:09 PM
Fredel
Fredel - avatar
+ 2
thanks.
25th Apr 2017, 7:01 PM
Muhammad Saimon Uddin
Muhammad Saimon Uddin - avatar