Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 479 Bytes

README.md

File metadata and controls

19 lines (16 loc) · 479 Bytes

#Prototype The prototype pattern is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. More…

$userA = new User();
$userA->setName('Dzyanis');
$userA->setAge(27);
echo $userA->info() . PHP_EOL;
// Name Dzyanis, age 27

$userB = clone $userA;
echo $userB->info() . PHP_EOL;
// Name Dzyanis, age 27

##Diagram Prototype UML Diagram