Bug #78093 [PATCH]: mt_rand returns NULL in some cases

From: Date: Fri, 31 May 2019 14:48:20 +0000
Subject: Bug #78093 [PATCH]: mt_rand returns NULL in some cases
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221064@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78093&edit=1 ID: 78093 Patch added by: sidorovmarat1995@gmail.com Reported by: sidorovmarat1995 at gmail dot com Summary: mt_rand returns NULL in some cases Status: Open Type: Bug Package: Math related Operating System: All PHP Version: 7.2.19 Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: mt-rand Revision: 1559314100 URL: https://bugs.php.net/patch-display.php?bug=78093&patch=mt-rand&revision=1559314100 Previous Comments: ------------------------------------------------------------------------ [2019-05-31 14:47:30] sidorovmarat1995 at gmail dot com Description: ------------ In mt_rand docs I can't find possibility of returning NULL. I suggest return false in this situation(see test script). Test script: --------------- <?php var_dump(mt_rand(INF,INF)); var_dump(mt_rand(INF,NULL)); Expected result: ---------------- bool(false) bool(false) Actual result: -------------- NULL NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78093&edit=1

« previous php.bugs (#221064) next »