<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/five-new-features-in-latte-3-1-that-will-make-your-life-easier-nette-blog-rbgmyosmy" -->

---
title: Five New Features in Latte 3.1 That Will Make Your Life...
description: Latte 3.1 introduces five practical improvements to the PHP templating engine. The `ScopedLoopVariables` feature prevents foreach loop variables from leaking...
canonical: https://daily.dev/posts/five-new-features-in-latte-3-1-that-will-make-your-life-easier-nette-blog-rbgmyosmy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Five New Features in Latte 3.1 That Will Make Your Life Easier – Nette Blog | daily.dev
og:description: Latte 3.1 introduces five practical improvements to the PHP templating engine. The `ScopedLoopVariables` feature prevents foreach loop variables from leaking...
og:url: https://daily.dev/posts/five-new-features-in-latte-3-1-that-will-make-your-life-easier-nette-blog-rbgmyosmy
og:image: https://api.daily.dev/og/posts/RBGMyosmy.png
og:image:alt: Five New Features in Latte 3.1 That Will Make Your Life Easier – Nette Blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Five New Features in Latte 3.1 That Will Make Your Life Easier – Nette Blog

**[Nette](https://daily.dev/sources/nette)** · 4 min read · 4 upvotes · 0 comments

## Summary

Latte 3.1 introduces five practical improvements to the PHP templating engine. The `ScopedLoopVariables` feature prevents foreach loop variables from leaking into the outer scope, restoring original values after the loop ends. The `Dedent` feature automatically removes common indentation inside paired tags at compile time with no runtime cost. Three new filters are added: `|commas` joins arrays with natural language separators (e.g., 'apple, pear and plum'), `|column` extracts a single column from arrays of records, and `|limit` takes the first N elements from arrays, iterators, or strings while preserving keys. The existing `|slice` filter is also extended to support iterators and generators with lazy memory-efficient evaluation. Both engine features are enabled via `setFeature()` or Nette configuration.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.nette.org/en/five-new-features-in-latte-3-1-that-will-make-your-life-easier>

## Similar posts on daily.dev

- [Latte 3.1: When a templating system truly understands HTML – Nette Blog](https://daily.dev/posts/latte-3-1-when-a-templating-system-truly-understands-html-nette-blog-rzcmjxq1y) · Nette · 50 upvotes · 1 comments
- [Twig 3.23: Introducing new operators and destructuring support \(Symfony Blog\)](https://daily.dev/posts/twig-3-23-introducing-new-operators-and-destructuring-support-symfony-blog--bk2cqn0wr) · Symfony · 0 upvotes · 0 comments
- [CakePHP is now fully generics-able – DerEuroMark](https://daily.dev/posts/cakephp-is-now-fully-generics-able-dereuromark-cwz39vwo6) · DerEuroMark · 3 upvotes · 0 comments
- [CakePHP 5.4 is around the corner – DerEuroMark](https://daily.dev/posts/cakephp-5-4-is-around-the-corner-dereuromark-ynzmlrpz0) · DerEuroMark · 2 upvotes · 2 comments

---

Tags: [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/five-new-features-in-latte-3-1-that-will-make-your-life-easier-nette-blog-rbgmyosmy)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Five New Features in Latte 3.1 That Will Make Your Life Easier – Nette Blog","url":"https://daily.dev/posts/five-new-features-in-latte-3-1-that-will-make-your-life-easier-nette-blog-rbgmyosmy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/five-new-features-in-latte-3-1-that-will-make-your-life-easier-nette-blog-rbgmyosmy"},"datePublished":"2026-04-07T18:01:21.605Z","dateModified":"2026-08-24T06:54:13.828Z","description":"Latte 3.1 introduces five practical improvements to the PHP templating engine. The `ScopedLoopVariables` feature prevents foreach loop variables from leaking...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d04f68ef9600d9f15c9cc0951ab73e39?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d04f68ef9600d9f15c9cc0951ab73e39?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Nette","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Nette","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/54476ee5012b4cdaa4811d869af060ed","url":"https://daily.dev/sources/nette"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/five-new-features-in-latte-3-1-that-will-make-your-life-easier-nette-blog-rbgmyosmy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nette","item":"https://daily.dev/sources/nette"},{"@type":"ListItem","position":3,"name":"Five New Features in Latte 3.1 That Will Make Your Life Easier – Nette Blog"}]}
```

