Skip to content

Instantly share code, notes, and snippets.

@davidchc
Created September 24, 2019 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidchc/e70b491c90b241326218387cd06cc725 to your computer and use it in GitHub Desktop.
Save davidchc/e70b491c90b241326218387cd06cc725 to your computer and use it in GitHub Desktop.
<?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