setVar is a complex function that is used to perform several functions which include
<?php
setVar($name);
echo $name; //null
<?php
$return = setVar($name, 'foo');
echo $return; //foo
<?php
$name = 'bar';
$return = setVar($name, 'foo');
echo $return; //bar
'foo' is set as a return custom value for $name if it is empty or it is not
previously defined. However, sample 2 shows that if $name was previously defined, its relative value will be returned rather than the alternate value.
<?php
$alt = 'bar';
setVar($value, $alt, true);
echo $value; //bar
$alt was predefined but $value was not predefined. By setting the
third parameter as true, $alt value will overide $value because $value
is empty or not previously defined. However, in the sample below, $value was previously defined which means that
$alt will not be able to modify the value of $value.
<?php $value = 'foo'; $alt = 'bar'; $return = setVar($value, $alt, true); echo $value; //foo echo $return; //foo