The reason for this is because the script originally stores the password entered as "password" (double quotes) rather than 'password' (single quotes). The single quotes in php mean that the value is taken as is. With using the double quotes the system treats the password as a variable for example $value unless the $ is at the end of the pw.
So for example a password of $12345 the system sees and empty variable named $12345
a password of 123$45 the system sees 123 and a empty variable named $45
hope that makes sense.
Thanks..