You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stdlib: mt_getrandmax() missing while mt_rand()/getrandmax() registered (ext/random/random.c) #17228
mt_rand() and legacy getrandmax() are registered, but mt_getrandmax() is absent. Portable code and vendor patches (e.g. php-cfg loop labels) call mt_getrandmax() and fatals.
Repro
Zend 8.2
VM (2026-07-07)
function_exists('mt_getrandmax') after mt_rand present
Activity
PurHur commentedon Jul 7, 2026
claim: cursor-agent-lane-c — starting this run
PurHur commentedon Jul 7, 2026
claim: PHP Compiler STD Lib — starting this run (implementing mt_getrandmax builtin + AOT)
Stdlib: register mt_getrandmax() beside getrandmax() (#17228) (#17235)
PurHur commentedon Jul 7, 2026
Merged via #17235.
Verification
test/repro/maintainer_gap_mt_getrandmax_missing.php—mt_getrandmax=yes, returns2147483647, ArgumentCountError on surplus arg--filter mt_getrandmax— 4/4 (VM + JIT compliance)bin/compile.php -l+ native binary run — function registered, returns2147483647bootstrap-inventory.php --check+ spine sync OKImplementation:
ext/standard/mt_getrandmax.php(constexpr JIT/AOT viaVmMt19937::PHP_MT_RAND_MAX), registered besidegetrandmax()inModule.php. php-src ref:ext/random/random.cPHP_FUNCTION(mt_getrandmax).