Yes, it is correct. The documentation for password_verify
states:
Note that
password_hash()
returns the algorithm, cost and salt as part of the returned hash. Therefore, all information that's needed to verify the hash is included in it. This allows the verify function to verify the hash without needing separate storage for the salt or algorithm information.
Of course it's also easy to see that this information is there by inspecting the output of password_hash
and crypt
(which is, to overgeneralize a bit, mostly the same thing).