|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-26 17:27 UTC] felipe@php.net
[2010-06-26 18:03 UTC] felipe@php.net
[2010-06-26 18:04 UTC] felipe@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: felipe
[2010-06-26 18:04 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Description: ------------ When defining a function alias internally in PHP, PHP_FALIAS requires an arginfo as the third parameter. For example gzwrite() is internally represented as a function alias to fwrite(): PHP_FALIAS(gzwrite, fwrite, NULL) Here however the argument info is not provided. This leads to the fact that the reflection api can't extract the parameters of gzwrite. Why does an FALIAS require an arginfo? Couldn't it just take the argument info of the alias function if the arginfo is null? The impact is that you can't determine the required arguments from the gzwrite function. I hacked the code and added the arginfo stuff and the reflection api immediatly noticed that gzwrite requires 2 parameters. We are doing massive static code analysis and our code analysis returns bogus results due to the fact that the reflection api can't report the real arguments of a function. Test script: --------------- <?php foreach (array("gzwrite","fwrite") as $function) { $refl=new ReflectionFunction($function); var_dump($refl->getNumberOfRequiredParameters()); var_dump($refl->getNumberOfParameters()); } ?> Expected result: ---------------- int(2) int(3) int(2) int(3) Actual result: -------------- int(0) int(0) int(2) int(3)