php性能检查更改var

I have a question about performance in php.

I have multiple variables of settings which I want to write in session. First I thought it would make sense to check it before if it need the change:

if($settings['search_rule'] != $searchRule)
{
    $_SESSION['search_rule'] = $searchRule;
}

But I am not sure if it would be better just write

$_SESSION['search_rule'] = $searchRule;

So I can skip the IF for less steps in code. I think not that it would make much difference but I want to improve my code.

For example if I have 10 settings and just one changes which one is faster?

if it is always will have a value, you can go with the second option.

$_SESSION['search_rule'] = $searchRule;