Constants in PHP are defined using the 'define' function. They are fairly slow in PHP.
There are instances where extensions (such as hidef) were written to improve the performance of the code.
This comes into picture when there are thousands of constants.
Beginning from PHP version 5.3, compile-time constants with the help of const NAME = VALUE; can also be used. They are relatively quicker.