diff options
author | Stanislav Malyshev <stas@php.net> | 2009-12-18 19:12:11 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2009-12-18 19:12:11 +0000 |
commit | 7f775864d1226857d2c0f1ae27cfe6a36c3ccbd0 (patch) | |
tree | 8a89924652e378368180c007f178fa11fe434225 /Zend/tests/bug50394.phpt | |
parent | 8831f4ca236154690edd51b1578cf443545c4984 (diff) | |
download | php-git-7f775864d1226857d2c0f1ae27cfe6a36c3ccbd0.tar.gz |
fix regression bug #50394: Reference argument converted to value in __call
Diffstat (limited to 'Zend/tests/bug50394.phpt')
-rw-r--r-- | Zend/tests/bug50394.phpt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/tests/bug50394.phpt b/Zend/tests/bug50394.phpt new file mode 100644 index 0000000000..e6069d3666 --- /dev/null +++ b/Zend/tests/bug50394.phpt @@ -0,0 +1,24 @@ +--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) + |