Constants are frequently used in functions that require specific values to be passed in. For example, a popular function is
extract(), which takes all the values in an array and places them into variables in their own right. You can choose to change the name of the variables as they are extracted using the second parameter—send it a 0 and it overwrites variables with the same names as those being extracted, send it a 1 and it skips variables with the same names, send it 5 and it prefixes variables only if they exist already, and so on. Of course, no one wants to have to remember a lot of numbers for each function, so you can instead use
EXTR_OVERWRITE for 0,
EXTR_SKIP for 1,
EXTR_PREFIX_IF_EXISTS for 5, and so on, which is much easier. ...