Find why the TypeError escapes the handler and why cleanup is not guaranteed.
php
<?php
function importRow(array $row): void
{
$stream = fopen('php://temp', 'w+');
try {
strlen($row);
} catch (Exception $error) {
echo "invalid row\n";
}
fwrite($stream, 'done');
fclose($stream);
}