<p><strong>Yes,</strong> Twig will parse it all down to PHP before running it. It stores the rendered PHP in a <code>/storage/runtime/compiled_templates/</code> file.</p>

<p><strong>No,</strong> Craft will not run anything inside the conditional if it's <code>false</code>. At that point, it's simply processing exactly as normal PHP would.</p>

<p>So no, you shouldn't be notably penalized for anything inside a falsey <code>if</code> statement.</p>

CC BY-SA 3.0
2017-08-18T16:09:10.597Z
2017-08-18T16:09:10.597Z
Lindsey D
<p>Does Craft parse the contents of a false/negative/empty conditional statement? So would you take a performance hit if you had a big chunk of code inside a conditonal that was false?</p>

<pre><code>{% set foo = "foo" %}
{% if foo == foo %}Small code {% else %} MASSIVE CODE{% endif %}
</code></pre>

<conditional>
Does Craft parse requests inside a conditional if it is false?
# Does Craft parse requests inside a conditional if it is false?

(Asked by: username_0 on 2017-08-18)

Does Craft parse the contents of a false/negative/empty conditional statement? So would you take a performance hit if you had a big chunk of code inside a conditonal that was false?
{% set foo = "foo" %}
{% if foo == foo %}Small code {% else %} MASSIVE CODE{% endif %}

**Tags:** conditional

---

## 1 answers

### Answer by username_1 on 2017-08-18. Score: 3 | Accepted answer

**Yes,** Twig will parse it all down to PHP before running it. It stores the rendered PHP in a `/storage/runtime/compiled_templates/` file.

**No,** Craft will not run anything inside the conditional if it's `false`. At that point, it's simply processing exactly as normal PHP would.

So no, you shouldn't be notably penalized for anything inside a falsey `if` statement.


---

