This function may work differently from php5 to php7, in the latter it seems to reference the variable, while in php5 it returns the original argument.
I have confirmed with the versions below, but this will require further confirmation as to whether this is a 5 versus 7 issue.
function test( $test ){
$test = '123';
echo func_get_arg(0);
}
test( '321' );
//in php 5.5.9, this script will write '321'
//in php 7.0.33, this script will write '123'