Instead of `isset()` in loop call:
```php
$read[$type] = '';
while (strlen($data = fread($pipe, 8192)) > 0) {
    $read[$type] .= $data;
}