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

Drupal 7

$string = format_string($string, $params);
$safe_string = check_plain($string);
$placeholder_string = drupal_placeholder($string);

Drupal 8

use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\Html;

$string = new FormattableMarkup($string, $params);
$safe_string = Html::escape($string);
// Note that the 'placeholder' class should not be used only to italicize text, and
// therefore there are few valid usecases for the code below.
$placeholder_string = new FormattableMarkup('%text', ['%text' => $string]);

Related change records

SafeMarkup methods are removed

See Twig autoescape enabled and text sanitization APIs updated for a full list of related change records.

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