But your solution accepts an empty string to, so this if would always skips the loop on an non empty string and only filter if $sValue is 0 or empty. So it would be wrong here.

An other solution would be if( $sValue === '' )

This would only skip the loop on an empty string. 

Btw in my tests i can't produce an empty value here.So it could be possible to remove this check completely.