diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index 52132b45d..46a6df104 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -713,6 +713,7 @@ class Twig_Environment if (null === $this->functions) { $this->loadFunctions(); } + $this->functions[$name] = $function; } diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index 6492e8806..77d511203 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -95,7 +95,7 @@ class Twig_TemplateTest extends Twig_Template { } - public function getAttribute($object, $item, array $arguments = array(), $type = Twig_Node_Expression_GetAttr::TYPE_ANY, $noStrictCheck = false) + public function getAttribute($object, $item, array $arguments = array(), $type = Twig_Node_Expression_GetAttr::TYPE_ANY, $noStrictCheck = false, $lineno = -1) { return parent::getAttribute($object, $item, $arguments, $type); }