Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Allow to prevent seed break on destruct #2014

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

l-vo
Copy link

@l-vo l-vo commented Jun 20, 2020

When using faker on several classes (in a non-static way; in a test suite for instance), Generator instances can be garbage-collected at any-time. But if it occurs during values generation from another Generator instance, seed previously set for mt_rand is canceled and the predictable value suite is broken.

This PR provides a restoreSeed method to control mt_rand seed restoration instant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants