diff options
Diffstat (limited to 'tests/lang/passByReference_009.phpt')
-rw-r--r-- | tests/lang/passByReference_009.phpt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/lang/passByReference_009.phpt b/tests/lang/passByReference_009.phpt new file mode 100644 index 0000000..1cbd87d --- /dev/null +++ b/tests/lang/passByReference_009.phpt @@ -0,0 +1,24 @@ +--TEST-- +Assignement as argument +--FILE-- +<?php + function foo(&$x, &$y) { $x = 1; echo $y ; } + + $x = 0; + foo($x, $x); // prints 1 .. + + + function foo2($x, &$y, $z) + { + echo $x; // 0 + echo $y; // 1 + $y = 2; + } + + $x = 0; + + foo2($x, $x, $x = 1); + echo $x; // 2 +?> +--EXPECTF-- +1012
\ No newline at end of file |