Converting to boolean: Considered FALSE

<?php
var_dump((bool) "");        // bool(false)
var_dump((bool) 1);         // bool(true)
var_dump((bool) -2);        // bool(true)
var_dump((bool) "foo");     // bool(true)
var_dump((bool) 2.3e5);     // bool(true)
var_dump((bool) array(12)); // bool(true)
var_dump((bool) array());   // bool(false)
var_dump((bool) "false");   // bool(true)
?>
  • The boolean FALSE itself.
  • The integer 0 (zero).
  • The float 0.0 (zero).
  • The empty string, and the string &amp;quot;0&amp;quot;.
  • An array with zero elements.
  • The special type NULL (including unset variables).
  • SimpleXML objects created from empty tags.

Converting to boolean: Considered FALSE — Structure map

Clickable & Draggable!

Converting to boolean: Considered FALSE — Related pages: