php various improvements