πŸ“Š PHP
Q. What will be the output?
Code:
class A {
  public function __invoke() { echo 'Invoked'; }
}
$obj = new A();
$obj();
  • (A) Invoked
  • (B) Error
  • (C) NULL
  • (D) Nothing
πŸ’¬ Discuss
βœ… Correct Answer: (A) Invoked

Explanation: __invoke allows object to be called like function.

Explanation by: Roshan
__invoke allows object to be called like function.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
3
Total Visits
πŸ“½οΈ
8 d ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
83%
Success Rate