Working around invokable class bug in PHP