#50394 [Fbk->Opn]: Reference argument converted to value in __call (regression from 5.3.0)
From: jani@php.net Date: Mon, 07 Dec 2009 07:49:07 +0000 Subject: #50394 [Fbk->Opn]: Reference argument converted to value in __call (regression from 5.3.0) References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-145465@lists.php.net to get a copy of this message
ID: 50394
Updated by: jani@php.net
-Summary: Reference argument converted to value in __call
Reported By: tstarling at wikimedia dot org
-Status: Feedback
+Status: Open
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.3.1
New Comment:
Nevermind, I didn't notice the versioin expected result. :)
Previous Comments:
------------------------------------------------------------------------
[2009-12-07 07:47:52] jani@php.net
Regression from what version?
------------------------------------------------------------------------
[2009-12-07 01:40:18] tstarling at wikimedia dot org
Description:
------------
This is a regression in the PHP 5.3.1 release. When you call a __call()
function with a reference parameter, it is silently converted to a
value, by the time it reaches the second argument to __call().
This breaks MediaWiki and has no obvious workaround.
Reproduce code:
---------------
function foo( &$x ) {}
class Proxy {
function __call( $name, $args ) {
debug_zval_dump( $args );
call_user_func_array( 'foo', $args );
}
}
$arg = 1;
$args = array( &$arg );
$proxy = new Proxy;
call_user_func_array( array( &$proxy, 'bar' ), $args );
Expected result:
----------------
PHP 5.3.0 produces:
array(1) refcount(4){
[0]=>
&long(1) refcount(5)
}
Actual result:
--------------
array(1) refcount(4){
[0]=>
long(1) refcount(3)
}
Warning: Parameter 1 to foo() expected to be a reference, value given
in /home/tstarling/src/php/stuff/test-reference-call.php on line 8
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50394&edit=1
Thread (29 messages)
- #50394 [Opn->Fbk]: Reference argument converted to value in __call
- #50394 [Fbk->Opn]: Reference argument converted to value in __call (regression from 5.3.0)
- #50394 [Tbd]: Reference argument converted to value in __call
- #50394 [Tbd->Opn]: Reference argument converted to value in __call
- #50394 [Opn]: Reference argument converted to value in __call
- #50394 [Opn->Csd]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Csd]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Csd]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Csd]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Csd]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
- Bug #50394 [Com]: Reference argument converted to value in __call
| « previous | php.bugs (#145465) | next » |
|---|