Zend
200-550 · Question #26
What is the output of the following code? class Base { protected static function whoami() { echo "Base "; } public static function whoareyou() { static::whoami(); } } class A extends Base { public…
The correct answer is C. Base B B A B. See the full explanation below for the reasoning.
Question
What is the output of the following code? class Base { protected static function whoami() { echo "Base "; } public static function whoareyou() { static::whoami(); } } class A extends Base { public static function test() { Base::whoareyou(); self::whoareyou(); parent::whoareyou();
Options
- AB B B B B
- BBase A Base A B
- CBase B B A B
- DBase B A A B
How the community answered
(30 responses)- A13% (4)
- B3% (1)
- C77% (23)
- D7% (2)
Community Discussion
No community discussion yet for this question.