Make the code compatible with php 5.3
Merge pull request #1 from patrickli/php53-compatibility

Make the code compatible with php 5.3