php 5.4 compat
Merge pull request #297 from will123195/2.2

php 5.4 compat