php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73994 ReflectionFunction unpack
Submitted: 2017-01-25 15:12 UTC Modified: -
Votes:2
Avg. Score:1.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: jurigag at gmail dot com Assigned:
Status: Closed Package: Reflection related
PHP Version: 7.1.1 OS: Ubuntu 14.04
Private report: No CVE-ID:
 [2017-01-25 15:12 UTC] jurigag at gmail dot com
Description:
------------
In php 7.1.0 in changelog there is written that there were added additional parameter to unpack function:

unpack() function accepts an additional optional argument $offset.

But in php 7.1.0 the number of parameters and required parameters is both 2. In php 7.1.1 both returns 3

Test script:
---------------
$test = new ReflectionFunction("unpack");
echo $test->getNumberOfRequiredParameters();
echo $test->getNumberOfParameters();

Expected result:
----------------
For php 7.1.0:
2
3
For php 7.1.1:
2
3

Actual result:
--------------
For php 7.1.0:
2
2
For php 7.1.1:
3
3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-25 18:07 UTC] danack@php.net
Probably the only thing that needs doing is replacing:

ZEND_BEGIN_ARG_INFO(arginfo_unpack, 0)

with

ZEND_BEGIN_ARG_INFO_EX(arginfo_unpack, 0, 0, 2)
 [2017-01-26 06:59 UTC] krakjoe@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=76a7470160f977e486a1c9953012241abb5c1159
Log: Fixed bug #73994 incorrect arginfo for unpack
 [2017-01-26 06:59 UTC] krakjoe@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Jul 23 14:01:36 2017 UTC