Quiz 14/27: Answer the following question

  • Suggested by FredBouchery
  • Created on 2020-10-05
  • Difficulty: expert

What will be displayed with PHP 8.0? 🤔

PHP Quiz n°14

Select your answer: 🧐


✅ { answer }: correct!

❌ { answer }: Wrong answer!

PHP variables in double-quoted strings are parse differently if they are between braces or not. Outside braces, PHP can access to properties but don't call methods. The right answer was '() / bar' because property 'bar' doesn't exists.
▶  Click here to run this code on 3v4l.org

Poll

  • A: bar / bar - 27.3%
    percent%
  • B: foo->bar() / bar - 42.4%
    percent%
  • ✅ C: () / bar - 15.2%
    percent%
  • D: Parse error - 15.2%
    percent%
▶  Click here to see the Twitter poll


Going further... 🤓

Want More? 🤔

New random question ⏩