Added compatibility with PHP 5.2

Hi, I wanted to use your plugin but it wasn't compatible with PHP 5.2 so I made it compatible. Cheers.