I guess I will never understand bitmasks.
This now seems to work in both PHP 5.2 and PHP 5.4, and I might even udnerstand why ;)