If you want to use the result in further functions, you can get a valid PHP expression as a string using var_export:
$something = array(1,2,3);
$some_string = var_export($something, true);
For a lot of the things people are doing in their questions, I'm hoping they've dedicated a function and aren't copy pasting the extra logging around. var_export achieves a similar output to var_dump in these situations.