πŸ“Š PHP
Q. What is the result of the following PHP code?
Code:
<?php
    class Person 
    {
        public $name = "Person"; 
        public function __construct($name) 
        { 
            $this->name = $name; 
        } 
    } 
    
    $p = new Person("John");  
    echo $p->name; 
?>
  • (A) Person
  • (B) John
  • (C) Error
  • (D) No Output
πŸ’¬ Discuss
βœ… Correct Answer: (B) John

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
122294
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Team MCQ Buddy
Publisher
πŸ“ˆ
95%
Success Rate