ID: 40694 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Verified Bug Type: Scripting Engine problem PHP Version: 5CVS-2007-03-02 (CVS) New Comment:
Summary from IRC: This should be fixable by selectively populating arg_info in zend_std_get_method() with a structure that turns on the pass rest by ref flag. That'll tell the macros in zend_vm_def.h to send the arguments by reference. From there, you might need to modify zend_std_call_user_call() a little bit where it's building the args array... (Havn't looked close enough to be sure) While addressing this, you should look at the return value as well, again this should be a minor matter of checking the __call implementation and flipping the return type in zend_std_get_method()... Previous Comments: ------------------------------------------------------------------------ [2007-03-02 17:27:59] [EMAIL PROTECTED] Description: ------------ __call() method does not allow specifying the arguments array by reference. Essentially this means that there is no way to return modified arguments when using overloading. Reproduce code: --------------- class Foo { function __call($method, &$args) { print $args[0]."\n"; $args[0] = 5; print $args[0]."\n"; return true; } } $v = 'str'; $o = new Foo(); $o->test($v); var_dump($v); Expected result: ---------------- str 5 int(5) Actual result: -------------- str 5 string(3) "str" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40694&edit=1