Skip to content
Guess outputBeginner5 questions

PHP type juggling: guess the output

Loose comparison, numeric strings and floats. Five short snippets, one output each.

  1. 01What does this print on PHP 8?
    <?php
    
    var_dump(0 == "a");
  2. 02What does this print?
    <?php
    
    var_dump("1" == "01");
  3. 03What does this print?
    <?php
    
    var_dump(null == false, null === false);
  4. 04What does this print?
    <?php
    
    echo "5" + "5", "5" . "5";
  5. 05What does this print?
    <?php
    
    var_dump(0.1 + 0.2 == 0.3);

Answers are scored on the server. Unanswered questions count as incorrect.

laravel.now is an independent community project. It is not affiliated with, endorsed by, sponsored by, or in any way officially connected to Laravel, Laravel LLC, Taylor Otwell, or the Laravel framework maintainers. Laravel is a trademark of Taylor Otwell. All other trademarks belong to their respective owners.

This site is operated by the makers of Lockhound. Links to Lockhound are promotional.