mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
7aacc705d0
Closes GH-5958
25 lines
502 B
PHP
25 lines
502 B
PHP
--TEST--
|
|
Bug #50394: Reference argument converted to value in __call
|
|
--FILE--
|
|
<?php
|
|
function inc( &$x ) { $x++; }
|
|
|
|
class Proxy {
|
|
function __call( $name, $args ) {
|
|
echo "$name called!\n";
|
|
call_user_func_array( 'inc', $args );
|
|
}
|
|
}
|
|
|
|
$arg = 1;
|
|
$args = array( &$arg );
|
|
$proxy = new Proxy;
|
|
call_user_func_array( array( $proxy, 'bar' ), $args );
|
|
call_user_func_array( array( $proxy, 'bar' ), array(&$arg) );
|
|
var_dump($arg);
|
|
?>
|
|
--EXPECT--
|
|
bar called!
|
|
bar called!
|
|
int(3)
|