Annotation of embedaddon/php/Zend/tests/bug50394.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #50394: Reference argument converted to value in __call
! 3: --FILE--
! 4: <?php
! 5: function inc( &$x ) { $x++; }
! 6:
! 7: class 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;
! 17: call_user_func_array( array( $proxy, 'bar' ), $args );
! 18: call_user_func_array( array( $proxy, 'bar' ), array(&$arg) );
! 19: var_dump($arg);
! 20: --EXPECT--
! 21: bar called!
! 22: bar called!
! 23: int(3)
! 24:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>