Skip to content

Commit

Permalink
Make calling seed() without parameters seeding the RNG with random se…
Browse files Browse the repository at this point in the history
…ed. This fixes issue fzaninotto#538
  • Loading branch information
schmengler committed Mar 19, 2015
1 parent 81f8e94 commit 8cc3bd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Faker/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ public function getProviders()

public function seed($seed = null)
{
mt_srand($seed);
if ($seed === null) {
mt_srand();
} else {
mt_srand($seed);
}
}

public function format($formatter, $arguments = array())
Expand Down

0 comments on commit 8cc3bd0

Please sign in to comment.