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

seed() without parameter is broken #538

Closed
schmengler opened this issue Mar 17, 2015 · 2 comments
Closed

seed() without parameter is broken #538

schmengler opened this issue Mar 17, 2015 · 2 comments

Comments

@schmengler
Copy link

Currently the generator allows seeding the RNG with arbitrary numbers:

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

Unfortunately, leaving out the parameter does not call mt_srand() without parameters, but with null which has the same effect as mt_srand(0) (tested on PHP 5.4 and PHP 5.6)

@fzaninotto
Copy link
Owner

Right, it shouldn't accept a null value. Would you mind submitting a patch for that?

schmengler added a commit to schmengler/Faker that referenced this issue Mar 19, 2015
schmengler added a commit to schmengler/Faker that referenced this issue Mar 19, 2015
@fzaninotto
Copy link
Owner

Fixed in #543

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

No branches or pull requests

2 participants