Be compatible with PHP<5.4.
Merge pull request #8 from Hywan/master

Be compatible with PHP<5.4