public function addToOutput(&$output, &$key, &$value)
{
return function () use(&$output, &$key, &$value) {
foreach (array('key', 'value') as $var) {
${$var} = trim(${$var});
if (empty(${$var})) {
continue;
}
if (preg_match('/^\\d*[a-zA-Z_]/', ${$var})) {
${$var} = var_export(${$var}, true);
}
}
$output[] = empty($value) ? $key : $key . ' => ' . $value;
$key = '';
$value = null;
};
}