Add is_string check before doning string comparing

...nction

Because sometime JSON data may be a multi dimension array as following:
array(
  "a": []
) 
In this case, this express will cause 2 PHP warning.