strtolower($a) <=> strtolower($b)); foreach ($new_local as $name => $data) { if (!is_array($data)) { throw new UnexpectedValueException('bad data for ' . $name); } $return_type = array_shift($data); echo '\'' . str_replace("'", "\'", $name) . '\' => [\'' . str_replace("'", "\'", $return_type) . '\''; if ($data) { $signature = []; foreach ($data as $param_name => $type) { $signature[] = '\'' . str_replace("'", "\'", $param_name) . '\'=>\'' . str_replace("'", "\'", $type) . '\''; } echo ', ' . implode(', ', $signature); } echo '],' . "\n"; } function get_changed_functions(array $a, array $b) { $changed_functions = []; foreach (array_intersect_key($a, $b) as $function_name => $a_data) { if (json_encode($b[$function_name]) !== json_encode($a_data)) { $changed_functions[$function_name] = $b[$function_name]; } } return $changed_functions; }