Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.0
Description: 

When creating new languages, you should always instantiate a Language object.

Earlier in Drupal 8:

$language = (object) array(
  'langcode' => 'it'
);
language_save($language);

Should use this instead:

$language = new Language(array(
  'langcode' => 'it'
);
language_save($language);

The proper defaults based on the language code (if known to Drupal) will be set.

Impacts: 
Module developers