Quiz 25/25: Answer the following question

  • Suggested by FredBouchery
  • Created on 2020-11-12
  • Difficulty: expert

PHP 8 quiz: What will be displayed? 🤔

PHP Quiz n°25

Select your answer: 🧐


✅ { answer }: correct!

❌ { answer }: Wrong answer!

PHP 8 has changed the concat's precedence. Prior to PHP 8, "3 . 7 + 5" gives the resultat "int(42)" but now, it's string "312" The right answer was "TypeError".
▶  Click here to run this code on 3v4l.org

Poll

  • A: int(42) - 17.9%
    percent%
  • B: string(3) "312" - 10.7%
    percent%
  • C: Deprecatred + "int(42)" - 7.1%
    percent%
  • ✅ D: TypeError - 64.3%
    percent%
▶  Click here to see the Twitter poll
Click here to see output differences between PHP versions

Prior to PHP 8, "3 . 7 + 5" gives the resultat "int(42)" and PHP 7.4 displays a deprecated even with error_reporting(0).



Going further... 🤓

Want More? 🤔

👈️ Get back to first question