Random Extension Polyfill for PHP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Anton Smirnov 1ffe409988 Run release image 4 hours ago
debug Import random/randomizer tests 3 months ago
docs Update docs to reflect PHP 8.2 final release 1 day ago
src Fall back to badscaling only directly in getInt 4 weeks ago
tests Prepare a test case for 9839 compatibility 4 weeks ago
.gitattributes do not export doc configs 5 months ago
.gitignore I always forget which one I use 4 months ago
.gitlab-ci.yml Run release image 4 hours ago
CHANGELOG.md Changelog for 1.0.1 4 weeks ago
COPYING.adoc Replace md headers with adoc 3 months ago
LICENSE.md Legalese 5 months ago
README.md Update docs to reflect PHP 8.2 final release 1 day ago
composer.json Move development to GitHub 4 weeks ago
phpcs.xml Apply code style to tests too 3 months ago
phpunit.xml.dist Test Secure 5 months ago
psalm.xml Psalm config and fixes 5 months ago


Random Extension Polyfill for PHP

PHP Packagist Gitlab pipeline status Codecov

This is a polyfill for the new ext-random extension that was released with PHP 8.2.


  • PHP 7.1
  • GMP extension is strongly recommended on PHP 7


composer require 'arokettu/random-polyfill'


The library aims to be compatible with ext-random as released in PHP 8.2.0 and subsequent patch releases.


Random Extension

Read the official PHP doc: https://www.php.net/manual/en/book.random.php

The Polyfill

Read full documentation here: https://sandfox.dev/php/random-polyfill.html

Also on Read the Docs: https://php-random-polyfill.readthedocs.io/


Please file issues on our main repo at GitHub: https://github.com/arokettu/php-random-polyfill/issues


The library is available as open source under the terms of the 3-Clause BSD License. See COPYING.adoc for additional licenses.