Fix syntax differences between php versions