Quiz 1/16: Answer the following question

Your progression: 6%

6%
  • Suggested by FredBouchery
  • Created on 2020-07-23
  • Difficulty: expert

What will be displayed? 🤔

PHP Quiz n°1

Select your answer: 🧐


✅ { answer }: correct!

❌ { answer }: Wrong answer!

PHP namespaces can contain space characters, but they can't begin with a backslash. The right answer was "A".
▶  Click here to run this code on 3v4l.org

Poll

  • ✅ A: Fatal error: Uncaught Error: Undefined constant 'Foo\Bar' - 12.5%
    percent%
  • B: Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR)' - 37.5%
    percent%
  • C: Foo\Bar\A - 17.5%
    percent%
  • D: Foo\Bar\B - 32.5%
    percent%
▶  Click here to see the Twitter poll
Click here to see output differences between PHP versions

As I am writing this quiz (2020-07-31), there is a slight difference between all versions and PHP 8.0.0alpha3:
With this last version, the exception message "Foo\Bar" is wrapped by double quotes instead of single quotes for other versions ('Foo\Bar'). 🤔



Going further... 🤓

Want More? 🤔

Next question ⏩