print_r в Twig Symfony

{{ my_variable | json_encode(constant('JSON_PRETTY_PRINT')) }}
Shadow