<?php class Person { private $fname; private $lname; // Constructor same class name here public function __construct($fname, $lname) { $this->fname = $fname; $this->lname = $lname; } // public method to show name public function showName() { echo "My name is: " . $this->fname . " " . $this->lname . "<br/>"; } } // creating class object $john = new Person("John", "Wick"); $john->showName();
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`