When developing in Drupal 8, I used the drupal_var_export() function a lot to print arrays to the screen so I could then copy and paste into code to create the same array. This saved me a lot of time. In Drupal 8 the drupal_var_export function no longer exists. Instead do the following:
Obviously you need the Devel module enabled.