Exercise Weekend

Let's do some more practice with booleans. Evaluate these conditions in your head and write down whether each one will be true or false. Then check your work inside of the PHP shell with the var_dump((boolean) $variable_to_check); method.

  • ( 2 > 5 )
  • ( 2 > 5 || 2 > 1 )
  • ( 2 > 5 && 2 > 1 )
  • ( "hobbit" )
  • ( "" || "hobbit" )
  • !( 4 < 3000 )
  • ( "apple pie" && "cat" == "cat" )
  • !( 1 < 1.5 && 1.5 < 0)