merges from php - upstream