com php-src: Fixes bug #74708 reflection signatures for random_bytes+random_int: ext/standard/basic_functions .c
ext/standard/tests/random/reflection.phpt

From: Date: Tue, 13 Jun 2017 06:11:25 +0000
Subject: com php-src: Fixes bug #74708 reflection signatures for random_bytes+random_int: ext/standard/basic_functions .c
ext/standard/tests/random/reflection.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98063@lists.php.net to get a copy of this message
Commit: 81b2533a68ffc4fdc7ba0a4b8e516fe1a495451f Author: Tyson Andre <tysonandre775@hotmail.com> Wed, 7 Jun 2017 23:50:20 -0700 Committer: Remi Collet <remi@php.net> Tue, 13 Jun 2017 08:11:25 +0200 Parents: 3968ffe7b36728abbfb1e72ba04a749c2a10c59e Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=81b2533a68ffc4fdc7ba0a4b8e516fe1a495451f Log: Fixes bug #74708 reflection signatures for random_bytes+random_int They have 1 and 2 required parameters, respectively See https://secure.php.net/manual/en/function.random-int.php Bugs: https://bugs.php.net/74708 Changed paths: M ext/standard/basic_functions.c A ext/standard/tests/random/reflection.phpt Diff: diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 99ca20f..7671cab 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1912,11 +1912,11 @@ ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0) ZEND_END_ARG_INFO() /* }}} */ /* {{{ random.c */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 1) ZEND_ARG_INFO(0, length) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 2) ZEND_ARG_INFO(0, min) ZEND_ARG_INFO(0, max) ZEND_END_ARG_INFO() diff --git a/ext/standard/tests/random/reflection.phpt b/ext/standard/tests/random/reflection.phpt new file mode 100644 index 0000000..2df6a33 --- /dev/null +++ b/ext/standard/tests/random/reflection.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #74708 Wrong reflection on random_bytes and random_int +--FILE-- +<?php +$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()); +?> +===DONE=== +--EXPECT-- +int(1) +int(1) +int(2) +int(2) +===DONE===

« previous php.cvs (#98063) next »