Bug #72305 [NEW]: ReflectionParameter::isCallable is not implemented properly
From: php at abiusx dot com
Operating system: OS X
PHP version: 7.0.7
Package: Reflection related
Bug Type: Bug
Bug description:ReflectionParameter::isCallable is not implemented properly
Description:
------------
ReflectionParameter::isCallable always returns false.
Test script:
---------------
<?php
foreach (get_defined_functions()['internal'] as $f)
{
$rf=new ReflectionFunction($f);
for ($i=0;$i<$rf->getNumberOfParameters();++$i)
{
$rp=new ReflectionParameter($f,$i);
if ($rp->isCallable())
echo $f," parameter ",$i,PHP_EOL;
}
}
Expected result:
----------------
It should return true for some parameters of some internal functions,
e.g. array_map param0.
Actual result:
--------------
Always false.
As far as I checked,
http://lxr.php.net/xref/PHP_7_0/ext/reflection/php_reflection.c#6413
it appears that isCallable is never set in the typehint of the function,
and the issue is not with reflection, but with the way functions are
stored.
--
Edit bug report at https://bugs.php.net/bug.php?id=72305&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72305&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72305&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72305&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72305&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72305&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72305&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72305&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72305&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72305&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72305&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72305&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72305&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72305&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72305&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72305&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72305&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72305&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72305&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72305&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72305&r=mysqlcfg
Thread (7 messages)
- php at abiusx dot com