PHP is_null() VS isset() VS empty() cheat sheet

Published by sandro_admin on

Because sometimes things aren’t so obvious, I decided to share my true table.

  • is_null – Finds whether a variable is NULL
  • isset – Determine if a variable is declared and is different than NULL
  • empty – Determine whether a variable is empty
True table

See example on repl.it at https://repl.it/@SandroMiguel/isset-vs-isnull-vs-empty

Categories: cheat sheet

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *