Quiz 2/16: Answer the following question

Your progression: 13%

13%
  • Suggested by FredBouchery
  • Created on 2020-07-20
  • Difficulty: expert

What will be displayed (PHP version >= 7.4)? 🤔

PHP Quiz n°2

Select your answer: 🧐


✅ { answer }: correct!

❌ { answer }: Wrong answer!

7.4 unpack a Traversable by keeping the iteration order, but it fails when the keys are strings, even if those strings are numeric. The right answer was "D".
▶  Click here to run this code on 3v4l.org

Poll

  • A: 42 - 42.6%
    percent%
  • B: 24 - 13%
    percent%
  • C: Parse error: syntax error, unexpected '...' (T_ELLIPSIS) - 14.8%
    percent%
  • ✅ D: Fatal error: Uncaught Error: Cannot unpack Traversable with string keys - 29.6%
    percent%
▶  Click here to see the Twitter poll


Going further... 🤓

Want More? 🤔

Next question ⏩