Problems with function on function.php

Did you try to use add_action without priority? On the last line, you specify the priority. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.

function test_1234567() {
  // Get term by name ''news'' in Categories taxonomy.
  $category = get_term_by('name', 'news', 'category');

  // Get term by name ''news'' in Tags taxonomy.
  $tag = get_term_by('name', 'news', 'post_tag');

  // Get term by name ''news'' in Custom taxonomy.
  $term = get_term_by('name', 'news', 'my_custom_taxonomy');

  // Get term by name ''Default Menu'' from theme's nav menus.
  // (Alternative to using wp_get_nav_menu_items)
  $menu = get_term_by('name', 'Default Menu', 'nav_menu');

  var_dump($category);
}

add_action( 'init', 'test_1234567' );

Also, you do not need to specify the priority, the default is 10.

tech