{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/8fe496625f910b5f94e8ebd9870408b4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"8fe496625f910b5f94e8ebd9870408b4","url":"https://api.github.com/users/FractalizeR","login":"FractalizeR","id":318489},"milestone":null,"updated_at":"2011-11-05T07:32:13Z","labels":[],"assignee":null,"closed_at":"2011-11-05T07:32:13Z","comments":8,"url":"https://api.github.com/repos/fabpot/Twig/issues/493","body":"```\r\n{% set breadcrumb = [{\"url\": \"services_optimization\", \"title\": \"page_title\"}] %}\r\n\r\n{% for i in 0 .. breadcrumb|length - 2 %}\r\n     <li><a href=\"{{ url(breadcrumb[i].url) }}\">{{breadcrumb[i].title|trans}}</a> <span class=\"divider\">/</span></li>\r\n{% endfor %}\r\n```\r\n\r\n```Fatal error: Unsupported operand types in Z:\\Denwer\\home\\expedio.local\\app\\cache\\dev\\twig\\02\\61\\95367f37a2dfdfe0009fe97c5370.php on line 247```\r\n\r\nLine 247 in compiled template is compiled as follows:\r\n```php\r\n$context['_seq'] = twig_ensure_traversable((range(0, twig_length_filter($this->env, $this->getContext($context, 'breadcrumb'))) - 2));\r\n```\r\n\r\nAdding parenthesis:\r\n\r\n```\r\n{% for i in 0 .. (breadcrumb|length - 2) %}\r\n     <li><a href=\"{{ url(breadcrumb[i].url) }}\">{{breadcrumb[i].title|trans}}</a> <span class=\"divider\">/</span></li>\r\n{% endfor %}\r\n```\r\n\r\n```\r\nError: Key \"-1\" for array with keys \"0\" does not exist in \"::layout.html.twig\" at line 84 \r\n```\r\n\r\nI think Twig should replicate here PHP behavior - completely skip cycle if  startRange < endRange.","html_url":"https://github.com/fabpot/Twig/issues/493","number":493,"title":"Invalid 'for' behavior when using startRange < endRange","id":2100101,"created_at":"2011-10-31T17:57:47Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/f1a2c5905e121d09feba5ad73898ffca?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f1a2c5905e121d09feba5ad73898ffca","url":"https://api.github.com/users/fabpot","login":"fabpot","id":47313},"updated_at":"2011-11-05T07:32:13Z","url":"https://api.github.com/repos/fabpot/Twig/issues/comments/2639317","body":"@nikic: done in 10c799fd90b","id":2639317,"created_at":"2011-11-05T07:32:13Z"}}