php-src/tests/lang/returnByReference.001.phpt

21 lines
226 B
PHP

--TEST--
Returning a reference from a function
--FILE--
<?php
function &returnByRef(&$arg1)
{
return $arg1;
}
$a = 7;
$b =& returnByRef($a);
var_dump($b);
$a++;
var_dump($b);
?>
--EXPECT--
int(7)
int(8)