Q1. What is the difference between == and === in PHP?
== is a loose comparison that performs type coercion before comparing — 0 == "foo" is true, "1" == 1 is true, null == false is true. === is a strict comparison that checks both value and type — 0 === "foo" is false. Always use === in application code to avoid unexpected bugs. The same applies to != vs !==. PHP 8 changed some loose comparison behaviours (0 == "foo" is now false) which broke code relying on old behaviour. In security-sensitive contexts like password comparison always use hash_equals() or password_verify().