go to bug id or search bugs for
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.
foreach (array("gzwrite","fwrite") as $function)
Add a Patch
Add a Pull Request
To get the arginfo from original function will decrease the performance and will lead to change the internal function structure...
I think is better to add the arginfo as the normal functions for the aliases.
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #52183 (Reflectionfunction reports invalid number of arguments for function aliases)
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.