🎉 Hooray! After 3 years of work, I've finally released the ebook on design patterns! Check it out »
Memento

Memento in PHP

Memento is a behavioral design pattern that allows making snapshots of an object’s state and restoring it in future.

The Memento doesn’t compromise the internal structure of the object it works with, as well as data kept inside the snapshots.

Learn more about Memento

Usage of the pattern in PHP

Complexity:

Popularity:

Usage examples: The actual applicability of the Memento pattern in PHP is very questionable. In most cases, you could make a copy of an object’s state easier by simply using serialization.

Memento in Other Languages

Design Patterns: Memento in Java Design Patterns: Memento in C# Design Patterns: Memento in Python Design Patterns: Memento in Ruby Design Patterns: Memento in Swift Design Patterns: Memento in TypeScript