- Suggested by FredBouchery
- Created on 2020-11-19
- Difficulty: expert
PHP 8 quiz: What will be displayed? 🤔

✅ { answer }: correct!
❌ { answer }: Wrong answer!
It is possible that two implemented interfaces use the same name, but the signatures must be identical. Since PHP 8, contravariance allows to widen the parameter type, so this code is allowed.▶ Click here to run this code on 3v4l.org
Poll
-
A: TypeError int expected - 10%
-
B: TypeError string expected - 8%
-
C: Fatal declaration compat. - 51%
-
✅ D: boolean - 31%