debugging an array while creating custom rule I am trying debug a custom rule I am creating. In my helper function I am calling an array I want to work with. I want to dpm the contents of the array so that I can see what is available, but it is not working. To check that there wasn't a problem with my array. I set up a new one inside the helper function.

$array = [
      "foo" =&gt; "bar",
      "bar" =&gt; "foo",
  ];


and then try to dpm the array:

dpm ("array: " . $array);


but all that is shown in the status message is:

array: Array


I have been trying other methods of printing the array like print_r but haven't had any success with these either. How should I be printing my array?
You can only have a string (not an array) as the second argument to dpm().

Try:

dpm($array, "array: ");