|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesadd.missing.reflection.args.master.patch (last revision 2015-02-27 20:39 UTC by kostyantyn dot lysyy at oracle dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-02-28 08:49 UTC] reeze@php.net
[2015-02-28 08:49 UTC] reeze@php.net
-Status: Open
+Status: Closed
[2015-02-28 08:49 UTC] reeze@php.net
[2015-02-28 08:50 UTC] reeze@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 04:00:01 2025 UTC |
Description: ------------ But reflection does not see the more recently added argument for some common functions: Here are the ones I've noticed: - setcookie (missing "httponly") - setrawcookie (missing "httponly") - spl_autoload_register (missing 2 optional params) - mktime (missing "is_dst") - gmmktime (missing "is_dst") spl_autoload_register seems to be fixed in 'master' so I did not include it in the fix. Test script: --------------- <?php $functionsWithMissingReflectionParams = array( 'setcookie' => 7 ,'setrawcookie' => 7 ,'spl_autoload_register' => 3 // missing in php 5.6.2-1 ,'mktime' => 7 ,'gmmktime' => 7 ); foreach($functionsWithMissingReflectionParams as $funcName => $expectCount) { $refl = new ReflectionFunction($funcName); if($expectCount != count($refl->getParameters())) printf("'%s' has %d != %d params, according to reflection\n", $funcName, count($refl->getParameters()), $expectCount); else unset($functionsWithMissingReflectionParams[$funcName]); } if(!$functionsWithMissingReflectionParams) echo "Everything works fine!\n"; Expected result: ---------------- Everything works fine! Actual result: -------------- 'setcookie' has 6 != 7 params, according to reflection 'setrawcookie' has 6 != 7 params, according to reflection 'spl_autoload_register' has 1 != 3 params, according to reflection 'mktime' has 6 != 7 params, according to reflection 'gmmktime' has 6 != 7 params, according to reflection