NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #3508 most downloaded on Packagist
Random Extension Polyfill for PHP
Latest stable
1.99.0
Last release 7 months ago
13 Apr 2026
Ships unpredictably
gaps range from 2 weeks to 1.5 years
Nearly every release is documented
notes for 15 of 15 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
18 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Empty release for PHP >= 8.2
Empty release for PHP >= 8.2
Sep 2, 2022
A special empty version to be installed on PHP >= 8.2.
By the PHP license 3.01 clause 5, updated the upstream license to the PHP License 4.0 (3-Clause BSD) making the library purely licensed under the 3-Cl
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Removed always included lib.php, now the library has absolutely no side effects in PHP 8.2+
Sep 10, 2025
Upgraded embedded arokettu/unsigned to 1.3.6, a more future-proof version
Apr 1, 2025
Unlock the upper PHP version because the lib will fall back to the native ext-random in 8.2+ anyway
Feb 20, 2025
Bump arokettu/unsigned to 1.2.1, previous versions may cause invalid results in Mersenne Twister on 32-bit systems.
Sep 7, 2023
Rely on symfony/polyfill-php82 for interface implementations and Random\Engine\Secure (#6), thanks to @nicolas-grekas
Since RC1/RC2 are compatible with last 4 release candidates of PHP 8.2 (RC2-RC5), RC2 is re-released as stable.
Since RC1/RC2 are compatible with last 4 release candidates of PHP 8.2 (RC2-RC5), RC2 is re-released as stable.
Oct 26, 2022
Since RC1/RC2 are compatible with last 4 release candidates of PHP 8.2 (RC2-RC5), RC2 is re-released as stable.
Speed up 32 bit calculations in 64 bit envs
Secure engine throws RandomException instead of Exception
Secure engine throws RandomException instead of ExceptionRandomizer::getBytes()Fix incompatibility with PHP 8.2.0 RC1
Exceptions are now compatible in most known cases
Hopefully the last alpha
Sep 1, 2022
Hopefully the last alpha
Verified compatibility with PHP 8.2.0 beta 3
Aug 19, 2022
Verified compatibility with PHP 8.2.0 beta 2
PcgOneseq128XslRr64Xoshiro256StarStarnextInt() and getInt($min, $max) like in beta 2Aug 5, 2022
PcgOneseq128XslRr64Xoshiro256StarStarnextInt() and getInt($min, $max) like in beta 2Verified compatibility of custom engines with the current PHP 8.2 master
getInt() now has proper signature getInt(int $min, int $max)arrayPickKeys() throws a warning because full compatibility is not achievable.
Thanks to @TimWolla for the explanation in #1
CryptoSafeEngineJul 31, 2022
getInt() now has proper signature getInt(int $min, int $max)arrayPickKeys() throws a warning because full compatibility is not achievable.
Thanks to [Tim Düsterhus][gh@TimWolla] for the explanation
CryptoSafeEngineNOTE: 0.2.0 currently is not fully compatible when using custom engines. This will be fixed in 0.3.0 after PHP 8.2.0 beta 2 is released with some crit
NOTE: 0.2.0 currently is not fully compatible when using custom engines. This will be fixed in 0.3.0 after PHP 8.2.0 beta 2 is released with some critical fixes.
Randomizer
$enginegetBytes($length)shuffleArray($array)shuffleBytes($bytes)arrayPickKeys($array, $num)Mt19937
Fixed Mt not generating enough data sometimes
Compatible with PHP 8.2.0 beta 1
getInt()getInt($min, $max)Jul 23, 2022
getInt()getInt($min, $max)One column per quarter.