private static function splitAtValue(array $numbers, $value) : array { $lower = []; $upper = []; $number_equal = 0; foreach ($numbers as $number) { if ($number < $value) { $lower[] = $number; } elseif ($number > $value) { $upper[] = $number; } else { $number_equal++; } } return ['lower' => $lower, 'upper' => $upper, 'equal' => $number_equal]; }