fabpot/Twig — Issue #589: Twig_Markup (via `set`) doesn't allow `length` or `empty` functions
Author: ericclemmons
Created: 2012-01-09 18:12:19+00:00
State: open

`Twig_Markup` doesn't allow the internal string to be compared via `length` or `empty` functions.

For example:

```jinja
{% set value %}
{%- if false -%}
some value that's never set
{%- endif -%}
{% endset %}

{{ value | length }} # 1
{{ value | empty }} # false
```

Perhaps [Countable](http://www.php.net/manual/en/class.countable.php) would work (https://github.com/fabpot/Twig/blob/master/lib/Twig/Extension/Core.php#L752) as well as specifying `__isset`.