add php implementation

php implementation and test