Add support for php-5.3

This PR aims to make the client work on php >= 5.3