Q. What will be the output?

Code:
class A { public static function test() { echo 'A'; } }
class B extends A { public static function test() { echo 'B'; } }
A::test(); B::test();
  • (A) AB
  • (B) BA
  • (C) AA
  • (D) BB
πŸ’¬ Discuss
βœ… Correct Answer: (A) AB
Explanation: Static methods are called based on class reference.
Explanation by: Roshan
Static methods are called based on class reference.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
24
Total Visits
πŸ“½οΈ
4 mo ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
99%
Success Rate