Depending on exactly what you want to do, the solution could be fairly simple. The following won't produce the formatted output that print_r provides, but it will allow you to output the structure of lists, arrays, and maps:
// Output a list
final List<String> list = new ArrayList<String>();
list.add("one");
list.add("two");
list.add("three");
list.add("four");
System.out.println(list);
// Output an array
final String[] array = {"four", "three", "two", "one"};
System.out.println(Arrays.asList(array));
// Output a map
final Map<String, String> map = new HashMap<String, String>();
map.put("one", "value");
map.put("two", "value");
map.put("three", "value");
System.out.println(map.entrySet());
For other types of objects you could use reflection to create a utility for this purpose.