This is done on purpose. Your crypt function, when the second argument consists of letters and numbers, uses only the first two characters "salt" for encryption, and these two characters are placed at the beginning of the result. In this way,
crypt("test", "test"); -> teH0wLIpW0gyQ crypt("test", "te"); -> teH0wLIpW0gyQ crypt("test", "tea"); -> teH0wLIpW0gyQ crypt("test", "temperature"); -> teH0wLIpW0gyQ etc.
This is done to easily verify that the password is correct, so crypt($password, crypt($password, $salt)) == crypt($password, $salt)
source share