fix php5 error on return write context