Quick Answer
password_hash() creates a secure hash using bcrypt or Argon2. It automatically generates and embeds a salt. password_verify() checks a plain password against the hash. Never use md5() or sha1() for passwords - they are fast and GPU-crackable. bcrypt is slow by design which makes brute-force attacks expensive. Always use these functions for storing user passwords.
Answer
password_hash() uses strong algorithms like bcrypt/argon2 with auto-salting, removing the need for manual security handling.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.