diff options
Diffstat (limited to 'tests/lang/passByReference_001.phpt')
-rw-r--r-- | tests/lang/passByReference_001.phpt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/lang/passByReference_001.phpt b/tests/lang/passByReference_001.phpt new file mode 100644 index 0000000000..c73eacc594 --- /dev/null +++ b/tests/lang/passByReference_001.phpt @@ -0,0 +1,37 @@ +--TEST-- +passing of function parameters by reference +--FILE-- +<?php +function f($arg1, &$arg2) +{ + var_dump($arg1++); + var_dump($arg2++); +} + +function g (&$arg1, &$arg2) +{ + var_dump($arg1); + var_dump($arg2); +} +$a = 7; +$b = 15; + +f($a, $b); + +var_dump($a); +var_dump($b); + +$c=array(1); +g($c,$c[0]); + +?> +--EXPECT-- +int(7) +int(15) +int(7) +int(16) +array(1) { + [0]=> + &int(1) +} +int(1)
\ No newline at end of file |