Multiple changes, merge php5.2 to php library