diff --git a/src/bind.inc.php b/src/bind.inc.php index ae6ae9e..87f66fe 100644 --- a/src/bind.inc.php +++ b/src/bind.inc.php @@ -158,7 +158,11 @@ function add_twig_support(\Twig\Environment $twig) $twig->addFunction(new \Twig\TwigFunction('Warn', function($e) { - echo "WARN: $e\n"; + //NOTE: we can't just echo the value because it will + // be rendered into resulting code + register_shutdown_function(function() use($e) { + echo "WARN: $e\n"; + }); } )); $twig->addFunction(new \Twig\TwigFunction('has_token',