|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-02-20 12:53 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2020-02-20 12:53 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 04:00:01 2025 UTC |
Description: ------------ Reflection getType function doesn't return a type Test script: --------------- function someFunction(string $param, int $param2 = null) {} $reflectionFunc = new ReflectionFunction('someFunction'); $reflectionParams = $reflectionFunc->getParameters(); var_dump($reflectionParams[0]->hasType()); echo '<br>'; var_dump($reflectionParams[1]->hasType()); echo '<br>'; var_dump($reflectionParams[0]->getType()); echo '<br>'; var_dump($reflectionParams[1]->getType()); Expected result: ---------------- bool(true) bool(true) string int Actual result: -------------- bool(true) bool(true) class ReflectionNamedType#4 (0) { } class ReflectionNamedType#4 (0) { }