"earth", "0010" => "unicorn", "0011" => "pegasus", "0100" => "alicorn", "0101" => "batpony", "0110" => "crystal", default => null, }; $species2 = match ($species2) { "0001" => "earth", "0010" => "unicorn", "0011" => "pegasus", "0100" => "alicorn", "0101" => "batpony", "0110" => "crystal", default => null, }; return [ 'shared_memory' => $sharedMemory, 'median' => $median, 'protector' => $protector, 'fictive' => $fictive, 'little' => $little, 'not_talking' => $notTalking, 'host' => $host, 'robot' => $robot, 'species' => array_filter([ $species1, $species2 ], function ($i) { return isset($i); }) ]; } function parseMetadata ($metadata) { if (isset($metadata)) { if ($metadata["bitset"]) { $m = parseBitset($metadata["bitset"]); $m["marefriends"] = $metadata["marefriends"] ?? []; $m["bitset"] = $metadata["bitset"] ?? []; $m["sisters"] = $metadata["sisters"] ?? []; $m["regression"] = $metadata["regression"] ?? null; $m["caretakers"] = $metadata["caretakers"] ?? []; $m["median"] = $metadata["median"] ?? null; } else { $m = $metadata; } return $m; } else { return $metadata; } }