πŸ“Š PHP
Q. Which magic method is called when an object is converted to string?
  • (A) __string()
  • (B) __toString()
  • (C) __convert()
  • (D) __print()
πŸ’¬ Discuss
βœ… Correct Answer: (B) __toString()

Explanation: __toString() defines string representation.

Explanation by: Kanak Sharma
__toString() defines string representation.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
1
Total Visits
πŸ“½οΈ
6 h ago
Published
πŸŽ–οΈ
Kanak Sharma
Publisher
πŸ“ˆ
80%
Success Rate