|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits              [2020-05-29 20:23 UTC] kocsismate@php.net
 
-Status:      Open
+Status:      Verified
-Assigned To:
+Assigned To: kocsismate
  [2020-05-29 20:23 UTC] kocsismate@php.net
  [2020-05-29 20:57 UTC] carusogabriel@php.net
  [2020-05-30 06:59 UTC] kocsismate@php.net
  [2020-05-30 06:59 UTC] kocsismate@php.net
 
-Status: Verified
+Status: Closed
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 13:00:01 2025 UTC | 
Description: ------------ Wrong ReflectionType for sprintf/printf args parameter. It should return ReflectionUnionType. Test script: --------------- <?php foreach (['sprintf', 'printf'] as $functionName) { $rf = new ReflectionFunction($functionName); $rp = $rf->getParameters()[1]; $rt = $rp->getType(); var_dump($functionName); var_dump($rp->getName()); var_dump($rt::class); if ($rt instanceof ReflectionNamedType) { var_dump($rt->getName()); } var_dump('--------'); } Expected result: ---------------- string(7) "sprintf" string(4) "args" string(19) "ReflectionUnionType" string(8) "--------" string(6) "printf" string(4) "args" string(19) "ReflectionUnionType" string(8) "--------" Actual result: -------------- string(7) "sprintf" string(4) "args" string(19) "ReflectionNamedType" string(39) "object|array|string|int|float|bool|null" string(8) "--------" string(6) "printf" string(4) "args" string(19) "ReflectionNamedType" string(39) "object|array|string|int|float|bool|null" string(8) "--------"