merge with php5
unit tests passed