I think, we should simply check for an empty string here:

```
if ($this->enableEscaping) {
    return $val==='' ? "''" : escapeshellarg($val);
} else {
    return $val;
}
```