print and print_r in Drupal 7 I'm working on some code for a custom Drupal 7 module the problem is i'm dealing with many arrays and strings. I have tried to use print(), and print_r() to output values so i can see what i'm working with but nothing is printed to the screen. Is Drupal 7 preventing this from happening? How do other Drupal 7 module developers output values? for example in JavaScript i can use console.log() and for PHP i would normally use print(), print_r(), and echo. But looks like Drupal is not permitting this from working in my PHP code. 

UPDATE:

In my module i have .inc file inside this file i have a method called list_builder($delta){} Inside this i have a switch() to handle different lists based on the $delta. This method is being executed on the cron_hook. It processes data from some outside sources and builds a json file. I'm at the point of building my json output but dealing with a lot of variables and need to be able to look at the variables at each spot in the process to know what data i'm dealing with while i build the output. I'm looking for a way to diagnostically test/display variables as i work on this module. I'm looking for a universal solution that works no mater what i'm doing.
It's the same as in other PHP applications with separate V layer - print and print_r, being directly PHP functions, don't know about anything in View layer of Drupal application. They cannot pass their output to theming chain, cache systems in place and so on. That said, they often works, but that's more a coincidence.

For array inspection, you should either use xdebug or, if you don't have time, patience or skill to set it up, use Devel module. Specifically, dpm, dvm, dpr and dvr functions will be useful for you. See this helpful demo page for details of their use.

TL;DR: Install Devel, replace print and print_r() calls with dvm(). Profit.