Created
September 24, 2019 17:53
-
-
Save davidchc/e70b491c90b241326218387cd06cc725 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
<?php | |
class Customer | |
{ | |
private $firstname; | |
private $lastname; | |
public function __construct(array $data = []) | |
{ | |
list($this->firstname, $this->lastname) = $data; | |
} | |
public function getNameComplete() | |
{ | |
return $this->firstname.' '. $this->lastname; | |
} | |
} | |
$name = new Customer(['David', 'CHC']); | |
echo $name->getNameComplete(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment