Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
class People {
public $cardID;
public $firstName;
public $lastName
publict __construct() {
$this->cardID = '3-4512-22-213542';
$this->firstName = 'Watcharamet';
$this->lastName = 'Srinethirothai';
}
private changeName($name) {
$this->firstName = $name;
}
public getFullName() {
return $this->firstName .' '. $this->lastName;
}
public setFirstName($name) {
$this->changeName($name);
}
}
$platoosom = new People();
$name = $platoosom->getFullName();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.