mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
24 lines
319 B
PHP
24 lines
319 B
PHP
--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
|