From: alexander dot moldova at gmail dot com
Operating system: ubuntu 12.10
PHP version: 5.4.10
Package: Reflection related
Bug Type: Bug
Bug description:calling closure when providing it as an arg from the args array
Description:
------------
calling closure when providing it as an arg from the args array provided as
the
second parameter for the invokeArgs method from \ReflectionMethod class
Test script:
---------------
method is:
public function simpleTest($a, callable $b, array $c)
{
return (int) call_user_func_array($b, $c) + $a;
}
$params is:
array (size=3)
0 => int 2
1 =>
object(Closure)[95]
2 =>
array (size=1)
0 => int 2
and calling:
$this->refl->invokeArgs(new Blablabla, $params);
will generate the bug
Expected result:
----------------
method returning value
Actual result:
--------------
Error: Argument 1 passed to {closure}() must be of the type array, integer
given
In fact instead or the array is provided the "int 2"
--
Edit bug report at https://bugs.php.net/bug.php?id=63857&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=63857&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=63857&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=63857&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63857&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63857&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63857&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63857&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63857&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63857&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63857&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63857&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63857&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63857&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63857&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63857&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63857&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63857&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63857&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63857&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63857&r=mysqlcfg