php 5.3 support

Tested on php 5.3.27