Improved php version