Hey, I have just reduced the price for all products. Let's prepare our programming skills for the post-COVID era. Check it out »

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.



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

Memento in C# Memento in C++ Memento in Go Memento in Java Memento in Python Memento in Ruby Memento in Rust Memento in Swift Memento in TypeScript