Bug #74386 [Opn->Csd]: Phar::__construct : wrong number of parameters by reflection
| From: | krakjoe@php.net | Date: | Mon, 29 May 2017 07:33:02 +0000 |
| Subject: | Bug #74386 [Opn->Csd]: Phar::__construct : wrong number of parameters by reflection | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209295@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74386&edit=1
ID: 74386
Updated by: krakjoe@php.net
Reported by: fabien dot villepinte at gmail dot com
Summary: Phar::__construct : wrong number of parameters by
reflection
-Status: Open
+Status: Closed
Type: Bug
Package: PHAR related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of fabien.villepinte@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2dee44c74c00636558b26f764232045127a5d1dd
Log: Fix Bug #74386 Phar::__construct(): wrong number of parameters by reflection
Previous Comments:
------------------------------------------------------------------------
[2017-05-06 11:59:19] fabien dot villepinte at gmail dot com
Phar::__construct expects at most 3 parameters, otherwise we get the following error:
PHP Fatal error: Uncaught ArgumentCountError: Phar::__construct() expects at most 3 parameters, 4
given
------------------------------------------------------------------------
[2017-04-06 16:23:39] fabien dot villepinte at gmail dot com
Description:
------------
According the documentation the method Phar::__construct( http://php.net/manual/en/phar.construct.php )
has only 3 parameters but by using reflection we can see there is a 4th parameter
("fileformat").
Test script:
---------------
<?php
$rm = new ReflectionMethod(Phar::class, "__construct");
foreach ($rm->getParameters() as $param) {
printf("param #%d: %s%s\n", $param->getPosition(), $param->getName(),
$param->isOptional() ? " (Opt.)" : "");
}
Actual result:
--------------
param #0: filename
param #1: flags (Opt.)
param #2: alias (Opt.)
param #3: fileformat (Opt.)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74386&edit=1