Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve performance of is defined in non strict mode

  • Loading branch information...
commit e4b8371ab412b63a7472c36aa74c840ad4f142bc 1 parent 661e9c7
@nikic nikic authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Twig/Node/Expression/GetAttr.php
View
4 lib/Twig/Node/Expression/GetAttr.php
@@ -20,7 +20,9 @@ public function compile(Twig_Compiler $compiler)
{
$compiler->raw('$this->getAttribute(');
- if ($this->hasAttribute('is_defined_test')) {
+ if ($this->hasAttribute('is_defined_test')
+ && $compiler->getEnvironment()->isStrictVariables()
+ ) {
$compiler->subcompile(new Twig_Node_Expression_Filter(
$this->getNode('node'),
new Twig_Node_Expression_Constant('default', $this->getLine()),
Please sign in to comment.
Something went wrong with that request. Please try again.