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

Previously, Drupal provided several procedural utility functions for manipulating elements within renderable arrays.
These element_* functions are now deprecated; Instead, use \Drupal\Core\Render\Element class methods.

Overview

Drupal 7 Drupal 8
element_children($elements) Element::children($elements)
element_property Element::property()
element_properties($element) Element::properties($element)
element_child($element_name) Element::child($element_name);
element_get_visible_children($elements) Element::getVisibleChildren($elements)
element_set_attributes($element, array $attributes) Element::setAttributes($element, array $attributes);

Code sample

Drupal 7

$elements = array();
$elements['foo'] = array(
  '#markup' => 'Hello',
);
element_children($elements);

element_property('#markup');

element_properties($elements['foo']);

element_child('foo');

element_get_visible_children($elements);

element_set_attributes($elements['foo'], array('#title' => 'Custom title')); 

Drupal 8


use Drupal\Core\Render\Element;


$elements = array();
$elements['foo'] = array(
  '#markup' => 'Hello',
);

Element::children($elements);

Element::property('#markup');

Element::properties($elements['foo']);

Element::child('foo');

Element::getVisibleChildren($elements);

Element::setAttributes($elements['foo'], array('#title' => 'Custom title'));

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done