From:             sebastian
Operating system: Irrelevant
PHP version:      5.3SVN-2011-10-26 (SVN)
Package:          Reflection related
Bug Type:         Bug
Bug description:ReflectionMethod::invoke*() does not work for pass-by-ref 
arguments

Description:
------------
ReflectionMethod::invoke*() does not work for methods that expect
pass-by-reference arguments.

Test script:
---------------
<?php
class Foo
{
    public function bar(&$baz)
    {
    }
}

$array  = array();
$object = new Foo;

$method = new ReflectionMethod('Foo', 'bar');
$method->invoke($object, $array);
?>

Actual result:
--------------
Warning: Parameter 1 to Foo::bar() expected to be a reference, value given
in /home/sb/test.php on line 13

Fatal error: Uncaught exception 'ReflectionException' with message
'Invocation of method Foo::bar() failed' in /home/sb/test.php:13
Stack trace:
#0 /home/sb/test.php(13): ReflectionMethod->invoke(Object(Foo), Array)
#1 {main}
  thrown in /home/sb/test.php on line 13


-- 
Edit bug report at https://bugs.php.net/bug.php?id=60140&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=60140&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=60140&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=60140&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=60140&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60140&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=60140&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=60140&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=60140&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=60140&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=60140&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=60140&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=60140&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=60140&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=60140&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=60140&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60140&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=60140&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=60140&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=60140&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=60140&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=60140&r=mysqlcfg

Reply via email to