xref: /PHP-5.6/Zend/tests/bug50394.phpt (revision fc1e17ee)
1--TEST--
2Bug #50394: Reference argument converted to value in __call
3--FILE--
4<?php
5function inc( &$x ) { $x++; }
6
7class Proxy {
8        function __call( $name, $args ) {
9		echo "$name called!\n";
10                call_user_func_array( 'inc', $args );
11        }
12}
13
14$arg = 1;
15$args = array( &$arg );
16$proxy = new Proxy;
17call_user_func_array( array( $proxy, 'bar' ), $args );
18call_user_func_array( array( $proxy, 'bar' ), array(&$arg) );
19var_dump($arg);
20--EXPECT--
21bar called!
22bar called!
23int(3)
24
25