Archive for October 22nd, 2013
Flags for PHP
Posted by Jurgen in Languages, Programming on October 22nd, 2013
In my last post I wrote about the enumerated type (Enum) for PHP. In C# an Enum can have multiple values when it has the [Flags] attribute. A flags enum can be seen as a bitwise mask which can be used to combine boolean properties of an entity into one single integer property. This might come in handy when filtering on these properties. In this article I show my implementation for a flags enum in PHP and demonstrate the use of it in an example.