"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, }; $species3 = match ($species3) { "0001" => "earth", "0010" => "unicorn", "0011" => "pegasus", "0100" => "alicorn", "0101" => "batpony", "0110" => "crystal", default => null, }; if ($little === 1) { $ageRegressor = true; $little = 0; } return [ 'shared_memory' => $sharedMemory, 'median' => $median, 'protector' => $protector, 'fictive' => $fictive, 'little' => $little, 'not_talking' => $notTalking, 'host' => $host, 'robot' => $robot, 'magic' => $magic, 'sensitivity' => $sensitivity, 'food' => $food, 'plush' => $plush, 'nonverbal' => $nonverbal, 'less_frequent' => $lessFrequent, 'age_spells' => $age, 'age_regressor' => $ageRegressor, 'sexually_active' => $sexuallyActive, 'species' => array_filter([ $species1, $species2, $species3 ], 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; $m["birth"] = $metadata["birth"] ?? null; $m["heat"] = $metadata["heat"] ?? null; } else { $m = $metadata; } return $m; } else { return $metadata; } }