nerdexam
Zend

200-710 · Question #30

What would be the output of the following code? namespace MyFramework\DB; class MyClass { static function myName() { return __METHOD__; } } print MyClass::myName();

The correct answer is B. MyFramework\DB\MyClass::myName. See the full explanation below for the reasoning.

Namespaces

Question

What would be the output of the following code? namespace MyFramework\DB; class MyClass { static function myName() { return METHOD; } } print MyClass::myName();

Options

  • AMyFramework\DB\MyClass\myName
  • BMyFramework\DB\MyClass::myName
  • CMyFramework\DB\MyClass->myName
  • DMyClass::myName

How the community answered

(28 responses)
  • A
    7% (2)
  • B
    71% (20)
  • C
    4% (1)
  • D
    18% (5)

Topics

#__METHOD__#magic constants#namespace-qualified names#static methods

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice