changed code to support php 5.3

not tested yet!
Merge pull request #1 from hansvn/php-5.3-support

update to support php 5.3