In PHP development, we often use constants to define some global configurations, such as paths, switches, service interfaces, etc. But in more modern or modular architectures, configuration arrays (such as config.php or .env environment variables) gradually replace a large number of global constant usage. To smooth migration or make compatibility comparisons, we may need to compare the constants defined in the current run environment to see if they can be replaced by values in the configuration array.
get_defined_constants