Drupal 8 variable_get
In Drupal 7

 $data =  variable_get('test_content_types');


In Drupal 8

 $data = \Drupal::state()-&gt;get('test_content_types'); 


For more information about about "get", "set", "delete" visit - Step 5: How to upgrade D7 variables to D8's state system.