One thing I notice about that line is that there way too many parentheses!

```
[COLOR="Red"]([/COLOR]
(
!empty($hostNameInfo)
||
!empty($hostAddressInfo)
)
&&
(
(
[COLOR="Red"]([/COLOR]$hostNameInput != $hostNameInfo[COLOR="Red"])[/COLOR]
||
[COLOR="Red"]([/COLOR]$hostAddressInput != $hostAddressInfo[COLOR="Red"])[/COLOR]
)
&&
(
[COLOR="Red"]([/COLOR]!empty($hostAddressInput)[COLOR="Red"])[/COLOR]
&&
[COLOR="Red"]([/COLOR]!empty($hostNameInput)[COLOR="Red"])[/COLOR]
)
)
[COLOR="Red"])[/COLOR];
```

You can safely remove all the red parentheses without changing the meaning of the line.

So then you get

```
(
!empty($hostNameInfo)
||
!empty($hostAddressInfo)
)
&&
(
(
$hostNameInput != $hostNameInfo
||
$hostAddressInput != $hostAddressInfo
)
&&
(
!empty($hostAddressInput)
&&
!empty($hostNameInput)
)
);
```

Next, take a look at this

```
(
$hostNameInput != $hostNameInfo
||
$hostAddressInput != $hostAddressInfo
)
&&
(
!empty($hostAddressInput)
&&
!empty($hostNameInput)
)
)
```

What you’re saying here is A && (B && C), but that is the same A && B && C. i.e., the parentheses don’t add anything and can be removed

So we get

```
(
!empty($hostNameInfo)
||
!empty($hostAddressInfo)
)
&&
(
(
$hostNameInput != $hostNameInfo
||
$hostAddressInput != $hostAddressInfo
)
&&
!empty($hostAddressInput)
&&
!empty($hostNameInput)
);
```

But now you’re using $hostAddressInput before checking if it’s empty (and analogously for $hostNameInfo), possibly resulting in a E_NOTICE php error, so let’s reverse those:

```
(
!empty($hostNameInfo)
||
!empty($hostAddressInfo)
)
&&
(
!empty($hostAddressInput)
&&
!empty($hostNameInput)
&&
(
$hostNameInput != $hostNameInfo
||
$hostAddressInput != $hostAddressInfo
)
);
```

Okay, now suppose $hostNameInfo is empty, and $hostAddressInfo isn’t. You will then get an E_NOTICE on the line `$hostNameInput != $hostNameInfo`

, because $hostNameInfo is empty.

So, I suppose you should do it as follows:

```
(
!empty($hostAddressInput)
&&
!empty($hostNameInput)
&&
(
(!empty($hostNameInfo) && $hostNameInput != $hostNameInfo)
||
(!empty($hostAddressInfo) && $hostAddressInput != $hostAddressInfo)
)
);
```

Now the outermost parentheses are redundant again, so we can remove those:

```
!empty($hostAddressInput)
&&
!empty($hostNameInput)
&&
(
(!empty($hostNameInfo) && $hostNameInput != $hostNameInfo)
||
(!empty($hostAddressInfo) && $hostAddressInput != $hostAddressInfo)
);
```

Does that make sense?