Possible reason for the output

abstract class theBase
{
	function theFunc($min,$max)
	{
		$func=function($value)
		{
			$increase=function(&$var)
			{
				$var++;
				return ($var+2);
			};
			return ($increase($value));
		};
		return (array_map($func,range($min,$max)));
	}
}

class theChild extends theBase
{
	function doMoreWork(&$var)
	{
		$var++;
                return($var+3);
	}
}

$theClass=new theChild;
$theArray=call_user_func_array(array($theClass,"theFunc"),array(3,5,7));
array_walk($theArray,array($theClass,"doMoreWork"));
print_r($theArray);

the output is :7,8,9

Can someone help why 7,8,9 and not 11,12,13 .In doMoreWork function ($var+3) is showing no effect why? Can someone help to understand this behavior.

Regards,
Priti

array_walk() only walks over each of the values, anything returned from the callback function (your theChild::doMoreWork()) has no effect on the values. If you want the ($var+3) to have an effect then you must assign it to $var.