![]() you can reset the unique modifier for all providers by passing true as first argument $faker-> unique( $reset = true)-> randomDigitNotNull // will not throw OverflowException since unique() was reset // tip: unique() keeps one array of values per provider // optional() sometimes bypasses the provider to return a default value instead (which defaults to NULL) $values = array() įor ( $i= 0 $i optional()-> randomDigit Print_r( $values) // // providers with a limited range will throw an exception when no new unique value can be generated $values = array() įor ( $i= 0 $i unique()-> randomDigitNotNull Įcho "There are only 9 unique digits not null, Faker can't generate 10 of them!" unique() forces providers to return unique values $values = array()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |