Const creates constants at compile-time, whereas define defines them at run time, which is the key distinction between the two methods. The majority of const's drawbacks stem from this.
Some disadvantages of const are:
- Cannot be used to conditionally define constants.
- Unlike define(), which accepts any expression, const accepts a static scalar (an integer, string, or other constant like true, false, null, or __FILE__). Constant expressions are now permitted in const since PHP 5.6.
- Unlike define(), which accepts any expression as a name, const requires a simple constant name.
I hope this helps you.