PhPHP · Lesson 2 of 8
Types, Conditions & Loops
PHP is dynamically typed but has grown a real type system. Learn the comparison gotcha (== vs ===) early — it's the classic PHP interview question for a reason.
⚠ Warning
== compares after type juggling: 0 == 'a' was true in old PHP, '1' == '01' is still true. === compares value AND type with no conversions. Use === and !== always; reserve == for the rare case you truly want coercion.
== compares after type juggling: 0 == 'a' was true in old PHP, '1' == '01' is still true. === compares value AND type with no conversions. Use === and !== always; reserve == for the rare case you truly want coercion.