Bug #74742 [Com]: ReflectionParameter::getType

From: Date: Sun, 11 Jun 2017 07:53:50 +0000
Subject: Bug #74742 [Com]: ReflectionParameter::getType
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209473@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74742&edit=1 ID: 74742 Comment by: joey@php.net Reported by: pierre at lgse dot com Summary: ReflectionParameter::getType Status: Open Type: Bug Package: Reflection related Operating System: CentOS PHP Version: 7.0Git-2017-06-11 (Git) Block user comment: N Private report: N New Comment: Above code returns: string(3) "int" string(7) "integer" Previous Comments: ------------------------------------------------------------------------ [2017-06-11 07:52:46] joey@php.net <?php class A { public function __construct(int $a){ $this->a = $a; } } var_dump((string)(new ReflectionClass('A'))->getConstructor()->getParameters()[0]->getType(), gettype(0)); ------------------------------------------------------------------------ [2017-06-11 07:37:06] spam2 at rhsoft dot net Provide a code sample - I have written a fuzzy testsuite based on reflection and didn't face such issurs6 ------------------------------------------------------------------------ [2017-06-11 07:24:55] pierre at lgse dot com Description: ------------ ReflectionParameter::getType should return "integer" and not "int" on a constructor parameter of type "int". The types returned by ReflectionParameter::getType and the gettype() function should be the same. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74742&edit=1

« previous php.bugs (#209473) next »