Liam Hammett explains what bitmask constants are and how they work.
PHP has a handful of core functions that can accept boolean arguments in the form of constants that have a binary value. These can be combined together in a single function argument, essentially passing multiple boolean flags in a very compact manner. They work a bit differently to how most people implement options in their userland functions, so let’s take a look at how they work.
Read more [medium.com]