Created
May 2, 2022 19:37
-
-
Save elishaukpong/3734f9034aa848e4f9928d09f9edc85e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OOPExample | |
{ | |
public function __construct($name) | |
{ | |
$this->name = $name; | |
} | |
public function sayName(){ | |
echo $this->name; | |
} | |
} | |
$john = new OOPExample('John'); | |
$john->sayName(); //John | |
$peter = new OOPExample('Peter'); | |
$peter->sayName(); // Peter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment