PHP | define() vs. const

As of PHP 5.3 there are two ways to define constants: Either using the const keyword or using the define() function: const FOO = ‘BAR’; define(‘FOO’, ‘BAR’); The fundamental difference between those two ways is that const defines constants at compile time, whereas define defines them at run time. This causes most of const‘s disadvantages. … Read more