Infinit loop when I 'print_r' variables like $form_state, $form I don't understand, I want show some vars during my dev. I work on windows and Linux. 

On windows, When I use print_r for show $form or $form_state (from the hook form_alter). There isn't any problem, when the page is loaded, I can see the content of theses vars.

But on linux, when I use print_r, I see the RAM (via top/htop) rise continuously until 4Go and my OS freeze x) The page I request is never loaded.

I don't understand because I don't think have a special configuration. My configuration is recent.

On Linux (Mint)

php -v : 5.6.14
apache2 -v : 2.4.10 (Raspbian)

Solution

Activate the sub-extend drupal Kint from the devel package :)
You might not like the answer, but it's still true: Don't use print_r() for $form/$form_state, entity or other complex objects. It just doesn't work.

Try kint() from the devel module instead, make sure to install the kint submodule too.