diff --git a/php/Job/Space/Select.php b/php/Job/Space/Select.php index 50ad150..34c4cb6 100644 --- a/php/Job/Space/Select.php +++ b/php/Job/Space/Select.php @@ -76,12 +76,12 @@ public function run(): array } if (!json_encode($data)) { - foreach ($data as $i => $tuple) { - foreach ($tuple as $k => $v) { + foreach ($data as $i => &$tuple) { + array_walk_recursive($tuple, function (&$v) { if (is_string($v) && !json_encode($v)) { - $data[$i][$k] = '!!binary ' . base64_encode($v); + $v = '!!binary ' . base64_encode($v); } - } + }); } }