Doc->Bug #74386 [Opn]: Phar::__construct : wrong number of parameters by reflection

From: Date: Sat, 06 May 2017 11:59:20 +0000
Subject: Doc->Bug #74386 [Opn]: Phar::__construct : wrong number of parameters by reflection
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208968@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 User updated by: fabien dot villepinte at gmail dot com Reported by: fabien dot villepinte at gmail dot com -Summary: Phar::__construct : undocumented parameter +Summary: Phar::__construct : wrong number of parameters by reflection Status: Open -Type: Documentation Problem +Type: Bug Package: PHAR related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#208968) next »