addon crashes on PHP version >= 5.4

I have used a deprecated syntax in one function, which has been removed in PHP version 5.4