Yes, in this case the second if is unnecessary, because $expected !== $actual. Repushed.

Now it is really very simple implementation ;-)