Hi Sandeep,
If you mean, why does the function not work, it is because the $num parameter is being passed by value, which is the default for basic types such as ints, booleans etc. In other words, a copy of the variable data is passed to addFive, not the actual bit of memory the variable points to, so the original $orignum value is never changed.
You need to change the function to pass it by reference, so that $num references the actual variable data - you can think of $num being an alias name for $orignum. In PHP you do this by putting & in front of it as so:
PHP Code:
<?php
function addFive(&$num)
{
$num +=5;
}
$orignum=190;
addFive($orignum);
echo $orignum;
?>
This will set value of orignum to 195 as you want.
You can read more about reference variables on the
PHP site.
HTH
Phil