200-710 Exam QuestionsBrowse all questions from this exam

200-710 Exam - Question 22


What is the output of the following code?

Show Answer
Correct Answer: AB

The output of the provided code will be 'MyNamespace\Test'. In PHP, using the `::class` constant on a class returns the fully qualified name of the class, including its namespace. Therefore, since the class Test is defined within the namespace MyNamespace, the output will be 'MyNamespace\Test'.

Discussion

2 comments
Sign in to comment
ZhukovPeterOption: A
Jan 4, 2020

Answer is A: namespace MyNamespace; class Test { } echo Test::class; output: MyNamespace\Test

[Removed]Option: A
Jun 20, 2020

The correct answer is A : MyNamespace\Test