WIP port to php 5.3

do not merge