xref: /PHP-8.2/Zend/tests/bug50394.phpt (revision 7aacc705)
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?>
21--EXPECT--
22bar called!
23bar called!
24int(3)
25