php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74708 Invalid Reflection signatures for random_bytes and random_int
Submitted: 2017-06-08 06:56 UTC Modified: 2017-06-13 06:17 UTC
From: tandre at themeetgroup dot com Assigned: remi (profile)
Status: Closed Package: Math related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2017-06-08 06:56 UTC] tandre at themeetgroup dot com
Description:
------------
ReflectionFunction returns 0 for getNumberOfRequiredParameters for random_bytes() and random_int(), but should return 1 and 2, respectively. 

Test script:
---------------
$rf = new ReflectionFunction('random_bytes');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());

$rf = new ReflectionFunction('random_int');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());


Expected result:
----------------
int(1)
int(1)
int(2)
int(2)


Actual result:
--------------
int(1)
int(0)
int(2)
int(0)


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-13 06:12 UTC] remi@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: remi
 [2017-06-13 06:17 UTC] remi@php.net
-Status: Assigned +Status: Closed
 [2017-06-13 06:17 UTC] remi@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Fixed in 
https://github.com/php/php-src/commit/81b2533a68ffc4fdc7ba0a4b8e516fe1a495451f
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC