Fix PHP compatibility with static constructors.