FakerPHP / Faker

Faker is a PHP library that generates fake data for you
https://fakerphp.github.io
Other
3.58k stars 345 forks source link

Add support for PHP 8.3 #694

Closed localheinz closed 9 months ago

localheinz commented 1 year ago

In all likelihood, PHP 8.3 will be released on November 23, 2023, and it would be great if we could support PHP 8.3 soon after the official release.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

ejunker commented 10 months ago

PHP 8.3 was released. What is remaining? The main issue I notice is with the deprecated MT_RAND_PHP constant.

Could it be solved by doing something like this?

$mode = PHP_VERSION_ID >= 80300 ? MT_RAND_MT19937 : MT_RAND_PHP;
mt_srand((int) $seed, $mode);
localheinz commented 9 months ago

Fixed with #844.

cs278 commented 7 months ago

This bug fix is arguably a BC break, it means Faker's output between differs when switching PHP version when using the same seed.

If we're happy changing the seeding in a patch release why not just use MT_RAND_MT19937 all the time? That mode is available on all supported PHP versions and means Faker doesn't change behaviour between PHP versions.