Skip to content

Latest commit

 

History

History

prototype

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

#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