# Closure

Closure is a programming technique for implementing lexically scoped name binding in a language with first-class functions; a procedure retains the environment that was current when it was created.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## PHP 8.6 is released!

DevFeed: [PHP 8.6 is released!](<https://devfeed.tech/articles/php-8-6-is-released-145241.md>)

Original publisher: [Read original article](<https://laravel-news.com/php-8-6-release-day>)

Author: Eric L. Barnes

Published: 2026-11-19T15:50:06Z

Content type: release

Language: en

Sources: [Laravel](<https://devfeed.tech/sources/laravel.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Closure](<https://devfeed.tech/topics/closure.md>)

Tags: [clamp](<https://devfeed.tech/tags/clamp.md>), [class](<https://devfeed.tech/tags/class.md>), [deprecations](<https://devfeed.tech/tags/deprecations.md>), [function](<https://devfeed.tech/tags/function.md>), [news](<https://devfeed.tech/tags/news.md>), [php](<https://devfeed.tech/tags/php.md>), [php-8-6](<https://devfeed.tech/tags/php-8-6.md>), [property](<https://devfeed.tech/tags/property.md>), [readonly](<https://devfeed.tech/tags/readonly.md>)

### AI overview

PHP 8.6 adds partial function application, which returns a closure after some function arguments are supplied; a clamp() function that keeps a value within bounds by returning the nearest bound when needed; and a final readonly Time\Duration class with nanosecond precision, unit-specific factories, arithmetic, and comparisons. Readonly properties can now have default values, allowing fixed values to satisfy get-only interface properties. The excerpt also mentions changed defaults and deprecations but does not detail them, and says the release includes more features.

### Source excerpt

PHP 8.6 is out with partial function application, a clamp() function, a Duration class, JSON error locations, readonly property defaults, and new deprecations. The post PHP 8.6 is released! appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

## EveryThing You Need To Know About Scala

DevFeed: [EveryThing You Need To Know About Scala](<https://devfeed.tech/articles/everything-you-need-to-know-about-scala-65415.md>)

Original publisher: [Read original article](<https://blog.devops.dev/everything-you-need-to-know-about-scala-c833fe885c44?source=rss----33f8b2d9a328---4>)

Author: Rahul Patidar

Published: 2026-10-06T13:04:28Z

Content type: article

Language: en

Sources: [DevOps.dev](<https://devfeed.tech/sources/devops-dev.md>)

Topics: [Scala](<https://devfeed.tech/topics/scala.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [class](<https://devfeed.tech/topics/class.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [constructor](<https://devfeed.tech/topics/constructor.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Learning](<https://devfeed.tech/topics/learning.md>), [superclass](<https://devfeed.tech/topics/superclass.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [block](<https://devfeed.tech/tags/block.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [closure](<https://devfeed.tech/tags/closure.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [factory](<https://devfeed.tech/tags/factory.md>), [frameworks](<https://devfeed.tech/tags/frameworks.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [monad](<https://devfeed.tech/tags/monad.md>), [none](<https://devfeed.tech/tags/none.md>), [nothing](<https://devfeed.tech/tags/nothing.md>), [null](<https://devfeed.tech/tags/null.md>), [packages](<https://devfeed.tech/tags/packages.md>), [recursion](<https://devfeed.tech/tags/recursion.md>), [scala](<https://devfeed.tech/tags/scala.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

The excerpt presents Scala interview topics through short explanations and code examples. It describes factory, singleton, and lazy initialization patterns; treating functions as values and higher-order functions; tail recursion, closures, placeholder syntax, partially applied functions, currying, purity, and anonymous functions. It also covers trait linearization in the diamond problem, monads, case class features, primary and auxiliary constructors, named Scala frameworks, exception handling without checked exceptions, BitSet, the App helper, package names, and Null, Nil, None, and Nothing. The supplied text ends mid-example in the factory pattern and is therefore an excerpt rather than evidence of the complete article.

### Source excerpt

Everyone who is a beginner in scala faces many problems and has many confusions while trying to understand important concepts in scala. In interviews, interviewers frequently ask about these concepts in Scala, and candidates are frequently unable to impress or explain these concepts to interviewers. So in today's post, I will be covering some important concepts in Scala, so whenever you go for your next interview, just read these concepts once and it will really help you to answer Scala Related Interview Questions. This post will cover the following topics: 1. Scala Design Patterns 2. First Class function 3. Higher-Order Functions 4. Tail Recursion in Scala. 5. Block of Code. 6. Closure 7. PlaceHolder Syntax: 8. Partially Applied Function: 9. Function Currying : 10. pure functions : 11. Anonymous Function: 12. Diamond Problem In scala: 13. traint in scala: 14. Monad in scala: 15. Case Classes In Scala. 16. constructors in Scala 17. Frameworks supported by Scala 18. Exception Handling in Scala 19. BitSet 20. app Class 21. Packages in Scala 22. Null, Nill, None, and Nothing in Scala Scala Design Patterns. Every time you develop some software, there are some common problems that everyone faces in his/her software engineering journey. To resolve these issues, we have some predefined general-purpose reusable solutions. These reusable solutions are nothing but design patterns. These are the types of templates that we can use as a solution whenever we encounter these issues. We have 3 kinds of design patterns in Scala. The factory design pattern: the main aim of the factory design pattern is to separate instance creation logic from the client. Here we implement instance creation logic in the factory class without exposing this logic to the client. It is used when we have multiple subclasses with one superclass and, based on the input, we need to return one of the inputs. Example trait Computer { def ram: String def hdd: String def cpu: String } case class PC(ram: String, h

## Python Inner Functions: What Are They Good For?

DevFeed: [Python Inner Functions: What Are They Good For?](<https://devfeed.tech/articles/python-inner-functions-what-are-they-good-for-60467.md>)

Original publisher: [Read original article](<https://realpython.com/inner-functions-what-are-they-good-for/>)

Author: Leodanis Pozo Ramos

Published: 2026-09-26T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [decorators](<https://devfeed.tech/tags/decorators.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

This tutorial explains Python inner functions and their uses, including accessing names in an enclosing scope, building closures that retain state across calls, and creating decorators that extend callable behavior.

### Source excerpt

Learn what a Python inner function is good for: accessing nonlocal names, building stateful closures, and writing your own decorators.

## Swift 6 Gave Me Zero Warnings, but Two Objective-C Callbacks Still Crashed at Runtime

DevFeed: [Swift 6 Gave Me Zero Warnings, but Two Objective-C Callbacks Still Crashed at Runtime](<https://devfeed.tech/articles/swift-6-gave-me-zero-warnings-but-two-objective-c-callbacks-still-crashed-at-runtime-58017.md>)

Original publisher: [Read original article](<https://hackernoon.com/swift-6-gave-me-zero-warnings-but-two-objective-c-callbacks-still-crashed-at-runtime?source=rss>)

Author: Amana

Published: 2026-09-22T14:42:08Z

Content type: article

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Actor](<https://devfeed.tech/topics/actor.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [actor](<https://devfeed.tech/tags/actor.md>), [amana](<https://devfeed.tech/tags/amana.md>), [apple](<https://devfeed.tech/tags/apple.md>), [bgtaskscheduler](<https://devfeed.tech/tags/bgtaskscheduler.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [crashes](<https://devfeed.tech/tags/crashes.md>), [dynamic-actor-isolation](<https://devfeed.tech/tags/dynamic-actor-isolation.md>), [ios](<https://devfeed.tech/tags/ios.md>), [ios-development](<https://devfeed.tech/tags/ios-development.md>), [isolation](<https://devfeed.tech/tags/isolation.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [shipaton](<https://devfeed.tech/tags/shipaton.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swift-6](<https://devfeed.tech/tags/swift-6.md>), [swift-concurrency](<https://devfeed.tech/tags/swift-concurrency.md>)

### AI overview

The article examines two runtime crashes caused by Swift 6 actor isolation interacting with Objective-C callbacks from BGTaskScheduler and PhotoKit. It explains why the compiler produced no warnings, how queue and isolation mismatches caused the crashes, and how the fixes were reproduced and validated.

### Source excerpt

How two Objective-C callbacks triggered Swift 6 actor-isolation crashes despite zero compiler warnings, and how the bugs were reproduced and fixed.

## Visualizing Nix closures

DevFeed: [Visualizing Nix closures](<https://devfeed.tech/articles/visualizing-nix-closures-54774.md>)

Original publisher: [Read original article](<https://fzakaria.com/2026/09/15/visualizing-nix-closures>)

Published: 2026-09-16T03:00:00Z

Content type: article

Language: en

Sources: [Farid Zakaria's Blog](<https://devfeed.tech/sources/farid-zakaria-s-blog.md>)

Topics: [Nix](<https://devfeed.tech/topics/nix.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [NixOS](<https://devfeed.tech/topics/nixos.md>), [Web app](<https://devfeed.tech/topics/webapp.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [nix](<https://devfeed.tech/tags/nix.md>), [nixos](<https://devfeed.tech/tags/nixos.md>), [visualization](<https://devfeed.tech/tags/visualization.md>), [web-app](<https://devfeed.tech/tags/web-app.md>)

### AI overview

The author introduces seenix.dev, an interactive browser-based tool that visualizes every byte in a Nix closure as pixels along a Hilbert curve. It can map closures from individual packages to large NixOS systems without server-side execution or downloading NARs for layout, and helps inspect dependencies and binary contents.

### Source excerpt

tl;dr seenix.dev lays every byte of a Nix closure out on a map, one pixel per byte, and lets you zoom from a whole NixOS system down to the hex of libc.so.6. Try hello, firefox or a GNOME desktop. Nothing runs on a server. With the advent of LLMs I keep tugging at any crazy question I ask myself. I know there is the anti-AI crowd and they will happily proclaim anything pursued in this vein as "slop" but I am feeling fortunate to be able to explore these questions.

## Going Backward: Reinventing Go's iterator

DevFeed: [Going Backward: Reinventing Go's iterator](<https://devfeed.tech/articles/going-backward-reinventing-go-s-iterator-60418.md>)

Original publisher: [Read original article](<https://antonz.org/going-backward/>)

Author: Anton Zhiyanov

Published: 2026-08-03T12:00:00Z

Content type: tutorial

Language: en

Sources: [Anton Zhiyanov](<https://devfeed.tech/sources/anton-zhiyanov.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>), [function](<https://devfeed.tech/topics/function.md>), [callback](<https://devfeed.tech/topics/callback.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [implementation](<https://devfeed.tech/topics/implementation.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [go-development](<https://devfeed.tech/tags/go-development.md>), [implementation](<https://devfeed.tech/tags/implementation.md>)

### AI overview

An exploration of how to build a generic iterator in Go, progressing from reversing a copied slice to closure-based and callback-based implementations. It discusses memory use, calling style, and early termination.

### Source excerpt

Building a generic iterator wheel from scratch.

## What's new in PHP 8.6

DevFeed: [What's new in PHP 8.6](<https://devfeed.tech/articles/what-s-new-in-php-8-6-44179.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/new-in-php-86>)

Author: Brent

Published: 2026-07-29T00:00:00Z

Content type: article

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [IO](<https://devfeed.tech/topics/io.md>), [async](<https://devfeed.tech/topics/async.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [function](<https://devfeed.tech/topics/function.md>), [interface](<https://devfeed.tech/topics/interface.md>), [properties](<https://devfeed.tech/topics/properties.md>), [ReactPHP](<https://devfeed.tech/topics/reactphp.md>), [Parameter](<https://devfeed.tech/topics/parameter.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [developers](<https://devfeed.tech/tags/developers.md>), [doc](<https://devfeed.tech/tags/doc.md>), [features](<https://devfeed.tech/tags/features.md>), [php](<https://devfeed.tech/tags/php.md>), [php-8-6](<https://devfeed.tech/tags/php-8-6.md>), [state](<https://devfeed.tech/tags/state.md>), [what-s-new](<https://devfeed.tech/tags/what-s-new.md>)

### AI overview

An overview of PHP 8.6, covering partial function application, default values for readonly properties, function parameter documentation comments, a new polling API, and deprecations. The article explains how the polling API supports internal development and may benefit lower-level frameworks such as ReactPHP or Amp.

### Source excerpt

Read the full post on https://stitcher.io/blog/new-in-php-86

## Porting the Scala 2 optimizer to Scala 3

DevFeed: [Porting the Scala 2 optimizer to Scala 3](<https://devfeed.tech/articles/porting-the-scala-2-optimizer-to-scala-3-43560.md>)

Original publisher: [Read original article](<https://www.scala-lang.org/blog/2026/03/23/porting-the-optimizer.html>)

Published: 2026-03-22T23:00:00Z

Content type: article

Language: en

Sources: [The Scala Programming Language](<https://devfeed.tech/sources/the-scala-programming-language.md>)

Topics: [Scala](<https://devfeed.tech/topics/scala.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [functional](<https://devfeed.tech/tags/functional.md>), [performance](<https://devfeed.tech/tags/performance.md>), [scala](<https://devfeed.tech/tags/scala.md>), [scala-3](<https://devfeed.tech/tags/scala-3.md>)

### AI overview

This post explains the work to port the Scala 2 optimizer to the Scala 3 compiler. The goal is to improve the performance of high-level functional Scala code without requiring developers to write more complex low-level code; early microbenchmarks reported 10-30% faster execution.

### Source excerpt

This post covers work done under the Sovereign Tech Fund investment umbrella: Maintenance of the Standard Library/Core Library Modules and APIs. The work is coordinated by the Scala Center. We are porting the optimizer from the Scala 2 compiler to the Scala 3 compiler, improving the performance of Scala 3 applications without requiring developers to write more complex code. In early microbenchmarks of code written in a high-level functional style, we're seeing 10-30% faster execution. But what exactly is this optimizer and why is it necessary? This work is available as of version 3.8.3-RC3 of the Scala compiler. Scala is a modern and concise language, meaning you can write code expressing what you want to do by composing primitives, rather than how to do it step-by-step. High-level code is easier to read and maintain, in addition to being shorter to write. Scala's expressiveness enables you to write what you mean: def addOneMap(a: Array[Int]) = a.map(_ + 1) However, from a CPU's point of view, a high-level API like map is conceptually more complex than the equivalent low-level code. It's a function call that is passed another function, leading to a "megamorphic" call site that is harder for the JVM to optimize, and the function argument might need a closure to be allocated on the heap if it captures local values. Compiled naïvely, the high-level call wouldn't be as fast as this equivalent low-level loop: def addOneLoop(a: Array[Int]) = val l = a.length val r = new Array[Int](l) var i = 0 while i < l do r(i) = a(i) + 1 i += 1 r You don't want to write this loop, because its purpose is a lot less obvious and it is harder to maintain, but without compiler help, you might have to write it if that function is critical to your application's performance. (Why would adding one to an array be critical to your app's performance? Because you're reading a pedagogical blog post and thus suspending disbelief!) If you've ever written a map function yourself, you may recognize the

## Partial function application in PHP 8.6

DevFeed: [Partial function application in PHP 8.6](<https://devfeed.tech/articles/partial-function-application-in-php-8-6-44214.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/php-86-partial-function-application>)

Author: Brent

Published: 2026-01-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [function](<https://devfeed.tech/topics/function.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Parameter](<https://devfeed.tech/topics/parameter.md>)

Tags: [argument](<https://devfeed.tech/tags/argument.md>), [closure](<https://devfeed.tech/tags/closure.md>), [function](<https://devfeed.tech/tags/function.md>), [php](<https://devfeed.tech/tags/php.md>), [php-8-6](<https://devfeed.tech/tags/php-8-6.md>), [version](<https://devfeed.tech/tags/version.md>)

### AI overview

This tutorial explains partial function application planned for PHP 8.6. It builds on first-class callables and closures, showing how argument placeholders can prefill selected parameters and make PHP's pipe operator easier to use.

### Source excerpt

Read the full post on https://stitcher.io/blog/php-86-partial-function-application

## PHP in 2026

DevFeed: [PHP in 2026](<https://devfeed.tech/articles/php-in-2026-44194.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/php-2026>)

Author: Brent

Published: 2026-01-12T00:00:00Z

Content type: article

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [pattern matching](<https://devfeed.tech/topics/pattern-matching.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [blog](<https://devfeed.tech/tags/blog.md>), [php](<https://devfeed.tech/tags/php.md>), [php-8-6](<https://devfeed.tech/tags/php-8-6.md>)

### AI overview

An overview of PHP developments expected in 2026, covering PHP 8.5 features, partial function application planned for PHP 8.6, a pattern matching RFC under discussion, and FrankenPHP's collaboration with the PHP Foundation.

### Source excerpt

Read the full post on https://stitcher.io/blog/php-2026

## Nim version 2.2.6 released

DevFeed: [Nim version 2.2.6 released](<https://devfeed.tech/articles/nim-version-2-2-6-released-53633.md>)

Original publisher: [Read original article](<https://nim-lang.org//blog/2025/10/31/nim-226.html>)

Published: 2025-10-31T00:00:00Z

Content type: release

Language: en

Sources: [Nim Programming Language](<https://devfeed.tech/sources/nim-programming-language.md>)

Topics: [Nim](<https://devfeed.tech/topics/nim.md>), [version](<https://devfeed.tech/topics/version.md>), [bugfixes](<https://devfeed.tech/topics/bugfixes.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Exception handling](<https://devfeed.tech/topics/exception-handling.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [copy](<https://devfeed.tech/topics/copy.md>), [return](<https://devfeed.tech/topics/return.md>), [Package Management](<https://devfeed.tech/topics/package-management.md>)

Tags: [2-2](<https://devfeed.tech/tags/2-2.md>), [announce](<https://devfeed.tech/tags/announce.md>), [async](<https://devfeed.tech/tags/async.md>), [bugfixes](<https://devfeed.tech/tags/bugfixes.md>), [builds](<https://devfeed.tech/tags/builds.md>), [closure](<https://devfeed.tech/tags/closure.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [copy](<https://devfeed.tech/tags/copy.md>), [download](<https://devfeed.tech/tags/download.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [install](<https://devfeed.tech/tags/install.md>), [nim](<https://devfeed.tech/tags/nim.md>), [release](<https://devfeed.tech/tags/release.md>), [return](<https://devfeed.tech/tags/return.md>), [version](<https://devfeed.tech/tags/version.md>)

### AI overview

The Nim team announces Nim 2.2.6, a patch release for the stable Nim 2.2 series containing 141 commits of bug fixes and improvements. The release updates exception handling and closure iterator transformation, enables a compiler move optimization for return field expressions, and includes installation guidance and numerous fixes.

### Source excerpt

The Nim Team is happy to announce version 2.2.6, the third patch release for our stable release, Nim 2.2. It comes six months after the 2.2.4 release and it contains 141 commits, bringing bugfixes and improvements. If you're still on Nim 1.6, take a look at the version 2.0 release article to see all the features you're missing. If you've been using Nim 2.0, the version 2.2 release article shows the improvements available in Nim 2.2. The Nim 2.2.6 changelog is available here. Highlights Exception handling combined with Nim's async is more stable than ever before as the underlying closure iterator transformation has been rewritten. The compiler is now smart enough to produce a move operation for return obj.field. Previously it performed a copy. Expect your code to run slightly faster due to this and other minor performance improvements. Installing Nim 2.2.6 Check out if the package manager of your OS already ships version 2.2.6 or install it as described here. If you have installed a previous version of Nim using choosenim, getting Nim 2.2.6 is as easy as: $ choosenim update self $ choosenim update stable NOTE: We recommend you to install and use the latest version of choosenim, v.0.8.16, available in our choosenim repo. Alternatively, you can download Nim 2.2.6 from our nightlies builds. Bugfixes Fixed "=destroy for non-var failed to compile when JS" (#24914) Fixed "{.push raises: [].} doesn't respect lexical scoping" (#23355) Fixed "Pragma block disabling warning has effect beyond block" (#21975) Fixed "missing < (less than), cmp for cstring" (#24941) Fixed "[GC] Illegal storage access when collecting cycle" (#4851) Fixed "Globals in proc with static params end up being re-initialized" (#24940) Fixed "Constructor to global variable in converter generates illegal c code" (#4594) Fixed "Compile-time regression from v2.2.4 to version-2-2/devel with global variable with unhandled exception: iterators.nim(254, 11) len(a) == L the length of the seq changed while iterating

## The pipe operator in PHP 8.5

DevFeed: [The pipe operator in PHP 8.5](<https://devfeed.tech/articles/the-pipe-operator-in-php-8-5-44250.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/pipe-operator-in-php-85>)

Author: Brent

Published: 2025-07-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Code](<https://devfeed.tech/topics/code.md>), [function](<https://devfeed.tech/topics/function.md>), [Closure](<https://devfeed.tech/topics/closure.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [php](<https://devfeed.tech/tags/php.md>)

### AI overview

This post explains the pipe operator introduced in PHP 8.5, including why it can improve deeply nested function calls and how values are passed from the left side to callable functions, closures, and invokable classes.

### Source excerpt

Read the full post on https://stitcher.io/blog/pipe-operator-in-php-85

## 10 Interview Questions Every JavaScript Developer Should Know in 2024

DevFeed: [10 Interview Questions Every JavaScript Developer Should Know in 2024](<https://devfeed.tech/articles/10-interview-questions-every-javascript-developer-should-know-in-2024-20711.md>)

Original publisher: [Read original article](<https://medium.com/javascript-scene/10-interview-questions-every-javascript-developer-should-know-in-2024-c1044bcb0dfb?source=rss----c0aeac5284ad---4>)

Author: Eric Elliott

Published: 2023-12-31T01:38:10Z

Content type: tutorial

Language: en

Sources: [Eric Elliot](<https://devfeed.tech/sources/eric-elliot.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Closure](<https://devfeed.tech/topics/closure.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [composition](<https://devfeed.tech/tags/composition.md>), [data-privacy](<https://devfeed.tech/tags/data-privacy.md>), [interview](<https://devfeed.tech/tags/interview.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [react](<https://devfeed.tech/tags/react.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [technology](<https://devfeed.tech/tags/technology.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

The guide presents ten JavaScript interview questions, explaining closures and their use for private state and partial application; pure functions and side effects; function composition and functional programming; Promises and async/await; TypeScript's typing and IDE benefits, with the caveat that type correctness does not ensure program correctness; Web Components as reusable browser-native elements; React Hooks and their usage rules; a useState click counter; and TDD's test, implement, refactor cycle. It describes TDD's potential benefits for design, bug detection, and deployability, while noting its learning curve and initial time cost. The author says interviewers should also assess a candidate's willingness and ability to learn, rather than treating incorrect answers as automatic grounds for rejection.

### Source excerpt

The world of JavaScript has evolved significantly, and interview trends have changed a lot over the years. This guide features 10 essential questions that every JavaScript developer should know the answers to in 2024. It covers a range of topics from closures to TDD, equipping you with the knowledge and confidence to tackle modern JavaScript challenges. As a hiring manager, I use all of these questions in real technical interviews on a regular basis. When engineers don't know the answers, I don't automatically reject them. Instead, I teach them the concepts and get a sense of how well they listen, and learn, and deal with the stressful situation of not knowing the answer to an interview question. A good interviewer is looking for people who are eager to learn and advance their understanding and their career. If I'm hiring for a less experienced role, and the candidate fails all of these questions, but demonstrates a good aptitude for learning, they may still land the job! 1. What is a Closure? A closure gives you access to an outer function's scope from an inner function. When functions are nested, the inner functions have access to the variables declared in the outer function scope, even after the outer function has returned: const createSecret = (secret) => { return { getSecret: () => secret, setSecret: (newSecret) => { secret = newSecret; }, }; }; const mySecret = createSecret("My secret"); console.log(mySecret.getSecret()); // My secret mySecret.setSecret("My new secret"); console.log(mySecret.getSecret()); // My new secret Closure variables are live references to the outer-scoped variable, not a copy. This means that if you change the outer-scoped variable, the change will be reflected in the closure variable, and vice versa, which means that other functions declared in the same outer function will have access to the changes. Common use cases for closures include: Data privacy Currying and partial applications (frequently used to improve function composition, e

## Optimize or Die. Profiling and Optimization in Jetpack Compose

DevFeed: [Optimize or Die. Profiling and Optimization in Jetpack Compose](<https://devfeed.tech/articles/optimize-or-die-profiling-and-optimization-in-jetpack-compose-23910.md>)

Original publisher: [Read original article](<https://medium.com/icerock/optimize-or-die-profiling-and-optimization-in-jetpack-compose-a165c8897b3f?source=rss----b74ae24564e---4>)

Author: IceRock Development

Published: 2023-04-28T03:14:45Z

Content type: article

Language: en

Sources: [IceRock Development](<https://devfeed.tech/sources/icerock-development-medium.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Compose Compiler](<https://devfeed.tech/topics/compose-compiler.md>), [GPU rendering](<https://devfeed.tech/topics/gpu-rendering.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [class](<https://devfeed.tech/topics/class.md>), [constraintlayout](<https://devfeed.tech/topics/constraintlayout.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [compose](<https://devfeed.tech/tags/compose.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [profiling](<https://devfeed.tech/tags/profiling.md>), [recomposition](<https://devfeed.tech/tags/recomposition.md>)

### AI overview

The Campus schedule screen stuttered during swipes; profiling exposed excessive recompositions and costly drawing work. The article recommends using Android Studio Layout Inspector's Recomposition Counts to locate frequently rerun composables, then Compose Compiler Metrics to inspect stability and skippability. It traces further recompositions to unstable inputs, collections, and recreated lambdas, and describes remedies including immutable types and collections, method references, and remembered lambdas. CPU profiling identified repeated SimpleDateFormat creation inside WeekPage's loop; moving it out and using remember reduced the reported draw time from about 95 ms to 60-70 ms. GPU profiling compares frame bars with the 16.67 ms target and can point to slow list updates, layout/measure work, or input and animation handling. The article also advises using remember for values that must survive recomposition, reserving lazy layouts for cases that need them, and preferring Row or Column over ConstraintLayout where possible.

### Source excerpt

Your brand-new app gets bombarded with user complaints on Google Play about it hanging or slowing down? Follow the tips in this article to fix it. Hello! My name is Sergey Panov, and I am a mobile developer at IceRock. Today, I will be using our Campus app as an example to demonstrate profiling and optimization techniques for Jetpack Compose. Campus is an app that allows students to view their class schedule. Its main feature is the schedule screen consisting of two pagers for weeks and days. When users tried to swipe them, it caused the app to hang, but we managed to fix it. Here are the topics discussed in the article: Recomposition Counts. Pinpointing Excessive Recompositions. Compose Compiler Metrics. Identifying the Root Causes of Excessive Recompositions. CPU Profiling. Finding "Hot" Methods and Freeing up the CPU. GPU Profiling. Learning Which Components Take a Long Time to Draw. More Tips on Fixing Bugs Identified with Profiling Tools. Recomposition Counts. Pinpointing Excessive Recompositions Issue. The first concept we need to highlight is that of recomposition. Rendering a screen in Compose consists of traversing the graph of composable functions. If a graph node changes its state (i.e. arguments of a composable method, values of MutableState or animations change), the subgraph is updated, that is, the functions are called again. Such an update is called a recomposition. Recompositions are fast and should not present any issues, but frequent recompositions can cause an app to slow down. This is a distinctive feature and a pitfall of Compose. After all, a developer can make some mistakes leading to excessive recompositions, for instance, recreate an object instead of reusing it. This results in unnecessary computations and performance issues. Solution. In large projects, these mistakes might be tricky to detect by the unaided eye, so Android Studio provides our eyes with an aid -- a tool called Recomposition Counts. It can be enabled in Layout Inspector to

## Optimize or Die. Profiling and Optimization in Jetpack Compose

DevFeed: [Optimize or Die. Profiling and Optimization in Jetpack Compose](<https://devfeed.tech/articles/optimize-or-die-profiling-and-optimization-in-jetpack-compose-24587.md>)

Original publisher: [Read original article](<https://medium.com/icerock/optimize-or-die-profiling-and-optimization-in-jetpack-compose-a165c8897b3f?source=rss-2f461fccc401------2>)

Author: IceRock Development

Published: 2023-01-25T06:55:43Z

Content type: tutorial

Language: en

Sources: [IceRock Development](<https://devfeed.tech/sources/stories-by-icerock-development-on-medium.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Compose Compiler](<https://devfeed.tech/topics/compose-compiler.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [GPU rendering](<https://devfeed.tech/topics/gpu-rendering.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [class](<https://devfeed.tech/topics/class.md>), [constraintlayout](<https://devfeed.tech/topics/constraintlayout.md>), [Google Play](<https://devfeed.tech/topics/google-play.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-compiler](<https://devfeed.tech/tags/compose-compiler.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [optimize](<https://devfeed.tech/tags/optimize.md>), [performance](<https://devfeed.tech/tags/performance.md>), [profiling](<https://devfeed.tech/tags/profiling.md>), [recomposition](<https://devfeed.tech/tags/recomposition.md>), [schedule](<https://devfeed.tech/tags/schedule.md>), [swipe](<https://devfeed.tech/tags/swipe.md>)

### AI overview

In the Campus schedule screen, swiping caused hangs; the article traces performance costs to repeated recompositions and expensive drawing work, then demonstrates profiling and fixes. Layout Inspector's Recomposition Counts identified ScheduleDayPage and RemoteStateContent recomposing three times per swipe. Compose Compiler Metrics exposed an unstable RemoteState argument; the article recommends stability annotations only when types truly cannot change, immutable collections for list stability, and remembered lambdas or method references to reduce recreated callbacks. CPU profiling found WeekPage spending about 95 ms in a four-second sample, partly because it created SimpleDateFormat inside a loop; moving and remembering that formatter reduced the reported draw time to 60-70 ms. GPU profiling compares frame bars with the 16.67 ms target and helps locate slow list updates, layout/measurement, animation, and input work. The excerpt also recommends remembering values across recompositions and using lazy layouts only when warranted.

### Source excerpt

Your brand-new app gets bombarded with user complaints on Google Play about it hanging or slowing down? Follow the tips in this article to fix it. Hello! My name is Sergey Panov, and I am a mobile developer at IceRock. Today, I will be using our Campus app as an example to demonstrate profiling and optimization techniques for Jetpack Compose. Campus is an app that allows students to view their class schedule. Its main feature is the schedule screen consisting of two pagers for weeks and days. When users tried to swipe them, it caused the app to hang, but we managed to fix it. Here are the topics discussed in the article: Recomposition Counts. Pinpointing Excessive Recompositions. Compose Compiler Metrics. Identifying the Root Causes of Excessive Recompositions. CPU Profiling. Finding "Hot" Methods and Freeing up the CPU. GPU Profiling. Learning Which Components Take a Long Time to Draw. More Tips on Fixing Bugs Identified with Profiling Tools. Recomposition Counts. Pinpointing Excessive Recompositions Issue. The first concept we need to highlight is that of recomposition. Rendering a screen in Compose consists of traversing the graph of composable functions. If a graph node changes its state (i.e. arguments of a composable method, values of MutableState or animations change), the subgraph is updated, that is, the functions are called again. Such an update is called a recomposition. Recompositions are fast and should not present any issues, but frequent recompositions can cause an app to slow down. This is a distinctive feature and a pitfall of Compose. After all, a developer can make some mistakes leading to excessive recompositions, for instance, recreate an object instead of reusing it. This results in unnecessary computations and performance issues. Solution. In large projects, these mistakes might be tricky to detect by the unaided eye, so Android Studio provides our eyes with an aid -- a tool called Recomposition Counts. It can be enabled in Layout Inspector to

## Performance in Jetpack Compose

DevFeed: [Performance in Jetpack Compose](<https://devfeed.tech/articles/performance-in-jetpack-compose-25901.md>)

Original publisher: [Read original article](<https://skyyo.medium.com/performance-in-jetpack-compose-9a85ce02f8f9?source=rss-56174fa84bcc------2>)

Author: Denys Rudenko

Published: 2022-10-03T16:41:03Z

Content type: article

Language: en

Sources: [Denis Rudenko](<https://devfeed.tech/sources/stories-by-denis-rudenko-on-medium.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [Compose Compiler](<https://devfeed.tech/topics/compose-compiler.md>), [mobile-app-performance](<https://devfeed.tech/topics/mobile-app-performance.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [inlining](<https://devfeed.tech/topics/inlining.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-compiler](<https://devfeed.tech/tags/compose-compiler.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [layout](<https://devfeed.tech/tags/layout.md>), [performance](<https://devfeed.tech/tags/performance.md>), [recomposition](<https://devfeed.tech/tags/recomposition.md>), [research](<https://devfeed.tech/tags/research.md>), [skip](<https://devfeed.tech/tags/skip.md>), [stable](<https://devfeed.tech/tags/stable.md>), [val](<https://devfeed.tech/tags/val.md>), [var](<https://devfeed.tech/tags/var.md>)

### AI overview

Compose can skip recomposition when a composable's parameters are considered stable. The excerpt says primitives and strings are stable, while mutable `var` fields make a class unstable; replacing them with `val` can allow a composable such as `UserDetails` to be skipped when its user has not changed. Lambdas that capture external variables may also be unstable because those variables become fields of the lambda. For simple cases, the article recommends references; for more involved lambdas, explicitly remembering them can reuse the same instance across recompositions. It says Compose Compiler Metrics and the layout inspector are used to inspect stability, restartability, skippability, and skipped recompositions. The excerpt begins discussing classes from non-Compose modules or libraries but cuts off before explaining that case or the article's other listed topics.

### Source excerpt

Article tells about my research on how to write efficient Compose code. It consists of 6 sections and a TL;DR/Summary in the end. We will cover: Optimising recompositions When should you use @Immutable and @Stable annotations; Unstable classes, variables, lambdas; Non-restartable & skippable composables; Lambda modifiers; Passing lambdas providing required fields instead of fields in composables; Inlined composables; When you should use remember { }. We'll be using Compose Compiler Metrics and layout inspector tools to know: - If a class is stable or not; - If the composable function is skippable/restartable; - Amount of skipped recompositions. 1. Unstable objects on UI layer. To understand why we should care about stability, let us peek into a very important metric called skippability. It allows compose runtime to skip recomposition of a composable when all the parameters it uses are considered stable. What is considered stable by the compiler? - All primitive value types: Boolean, Int, Long, Float, Char, etc. - Strings - Lambdas (not always, we will get to it later) We want composable functions to use stable params to become skippable. 1) Don't use var when seeking stability. Fields declared as var are considered unstable: https://medium.com/media/724da23ba38eaa9d3312318e7e8038b9/hrefhttps://medium.com/media/f8dd8a39bce60e48b5ff8bdd4a02b9ef/href UserDetails composable will be recomposed even if the user never gets modified. Using val instead of var in User class will fix this issue. 2) Not all lambdas are considered stable. Let's look at the following examples: https://medium.com/media/fbbff417d165a501b21a3e5d2c6f087f/hrefhttps://medium.com/media/c6aaae01fda67c633edcdf7bb351e620/href Since the lambdas capture outside scopes, they won't be automatically inferred as stable and reused as expected. If the lambda requires access to external variables, the compiler will add those variables as fields, which are passed into the constructor of the lambda. We go a 2 ways of

## Clojure Sound - 5 - Double Click with Foot Control

DevFeed: [Clojure Sound - 5 - Double Click with Foot Control](<https://devfeed.tech/articles/clojure-sound-5-double-click-with-foot-control-20723.md>)

Original publisher: [Read original article](<http://dragan.rocks/articles/22/Clojure-Sound-5-Double-Click-with-Foot-Control>)

Published: 2022-07-30T15:45:00Z

Content type: article

Language: en

Sources: [Dragan Djuric](<https://devfeed.tech/sources/dragan-djuric.md>)

Topics: [User interface design](<https://devfeed.tech/topics/ui-design.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>)

Tags: [button](<https://devfeed.tech/tags/button.md>), [clicks](<https://devfeed.tech/tags/clicks.md>), [clip](<https://devfeed.tech/tags/clip.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [control](<https://devfeed.tech/tags/control.md>), [controller](<https://devfeed.tech/tags/controller.md>), [midi](<https://devfeed.tech/tags/midi.md>), [music](<https://devfeed.tech/tags/music.md>), [playback](<https://devfeed.tech/tags/playback.md>), [receiver](<https://devfeed.tech/tags/receiver.md>), [rewind](<https://devfeed.tech/tags/rewind.md>), [simple](<https://devfeed.tech/tags/simple.md>), [sound](<https://devfeed.tech/tags/sound.md>), [time](<https://devfeed.tech/tags/time.md>), [user-interface](<https://devfeed.tech/tags/user-interface.md>), [value](<https://devfeed.tech/tags/value.md>)

### AI overview

The article builds foot control for clip playback from MIDI messages that alternate between values 0 and 127. It treats each press or release as an immediate stop or start, then recognizes a double-click when a message from the same button arrives within 600,000 microseconds of the previous one. A closure stores the prior message and timestamp in Clojure volatiles. The `play-control` logic rewinds on a double-click or when the clip is within one second of its end; otherwise it starts or stops according to the value. This keeps double-click behavior simple: the clip resumes its prior playing or stopped pattern from the beginning. The excerpt notes that end-of-track detection can be imprecise and that the controller's LED may not reflect playback after a clip ends.

### Source excerpt

In the last article we created a receiver function that listened to signals from our foot controller and started or stopped playback on consecutive clicks. The trouble with our player it that it only works until the end of the track. The start! function does not automatically rewind the playback. Neither stop! does that. Our program is responsible for detecting that the track should be rewound, perhaps by detecting that we reached the end of track (but even that is not fool proof, since audio infrastructure is not that precise). Now we have to think about a foot user interface that is useful and simple at the same time - there's not many different precise actions that a foot can do. My idea at this time is the following: distinguish three gestures: Button (un)pressed (value 0) Button pressed (value 127) Button pressed twice in a short time span (doubleclick). This can have two varieties: First pressed (value 127), then (un)pressed (value 0) (Un)pressed (value 0), then pressed (value 127). The values 0 and 127 always interchange, there's no way to send the same value twice in a row (with the MIDI controller I have). This gives us 4 different signals from one button that we can work with, which doesn't seem that much, but on the other hand, we can't assume that the feet of our user that is doing all this stomping is able or eager for much more complicated stuff. So, if I assume that the particular button is dedicated to a particular clip playback, I see the following actions: If the button is (un)pressed (value 0), the clip should stop, regardless of the previous state. If the clip has not been playing, nothing changes. If the button is pressed (value 127), the clip should start, regardless of the previous state. If the clip has been playing, it just keeps playing. If the button is clicked twice in a row, the things might get complicated! It's not exactly rocket science level complicated, but we still need to think what to do. In our desktop user interface toolkits, w

## Hooks, Dependencies and Stale Closures

DevFeed: [Hooks, Dependencies and Stale Closures](<https://devfeed.tech/articles/hooks-dependencies-and-stale-closures-48193.md>)

Original publisher: [Read original article](<https://tkdodo.eu/blog/hooks-dependencies-and-stale-closures>)

Published: 2022-04-24T00:00:00Z

Content type: article

Language: en

Sources: [TkDodo](<https://devfeed.tech/sources/tkdodo-s-blog.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [hooks](<https://devfeed.tech/topics/hooks.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [ESLint](<https://devfeed.tech/topics/eslint.md>), [lint](<https://devfeed.tech/topics/lint.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [eslint](<https://devfeed.tech/tags/eslint.md>), [hooks](<https://devfeed.tech/tags/hooks.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [lint](<https://devfeed.tech/tags/lint.md>), [react](<https://devfeed.tech/tags/react.md>), [react-hooks](<https://devfeed.tech/tags/react-hooks.md>)

### AI overview

This article explains how JavaScript closures interact with React hooks and dependencies, focusing on stale closures, their subtle runtime behavior, and how the react-hooks/exhaustive-deps ESLint rule can detect related issues statically.

### Source excerpt

Let's demystify what stale closures are in combination with react hooks with the help of the analogy of taking a photo ...

## What's new in PHP 8.1

DevFeed: [What's new in PHP 8.1](<https://devfeed.tech/articles/what-s-new-in-php-8-1-44174.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/new-in-php-81>)

Author: Brent

Published: 2021-11-25T00:00:00Z

Content type: article

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [enum](<https://devfeed.tech/topics/enum.md>), [Code](<https://devfeed.tech/topics/code.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Parallelism](<https://devfeed.tech/topics/parallelism.md>), [properties](<https://devfeed.tech/topics/properties.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Parameter](<https://devfeed.tech/topics/parameter.md>), [syntax](<https://devfeed.tech/topics/syntax.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [enums](<https://devfeed.tech/tags/enums.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [php](<https://devfeed.tech/tags/php.md>), [php-8-1](<https://devfeed.tech/tags/php-8-1.md>), [post](<https://devfeed.tech/tags/post.md>), [properties](<https://devfeed.tech/tags/properties.md>), [what-s-new](<https://devfeed.tech/tags/what-s-new.md>)

### AI overview

An overview of the new features, performance improvements, changes, and deprecations introduced in PHP 8.1, including enums, fibers, inheritance caching, string-key array unpacking, readonly properties, first-class callable syntax, and intersection types.

### Source excerpt

Read the full post on https://stitcher.io/blog/new-in-php-81

## Why we need multi-line short closures in PHP

DevFeed: [Why we need multi-line short closures in PHP](<https://devfeed.tech/articles/why-we-need-multi-line-short-closures-in-php-44338.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/why-we-need-multi-line-short-closures-in-php>)

Author: Brent

Published: 2021-06-03T00:00:00Z

Content type: opinion

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [function](<https://devfeed.tech/topics/function.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [functions](<https://devfeed.tech/tags/functions.md>), [php](<https://devfeed.tech/tags/php.md>), [return](<https://devfeed.tech/tags/return.md>), [right](<https://devfeed.tech/tags/right.md>), [statement](<https://devfeed.tech/tags/statement.md>), [variables](<https://devfeed.tech/tags/variables.md>)

### AI overview

An opinion article argues that PHP should add multi-line short closures, also called auto-capturing multi-statement closures. It explains the limitations of current arrow functions, outlines the proposed RFC, and discusses how variable capture, multiple statements, and return behavior would work.

### Source excerpt

Read the full post on https://stitcher.io/blog/why-we-need-multi-line-short-closures-in-php

## JavaScript Pass By Value Function Parameters

DevFeed: [JavaScript Pass By Value Function Parameters](<https://devfeed.tech/articles/javascript-pass-by-value-function-parameters-51820.md>)

Original publisher: [Read original article](<https://kentcdodds.com/blog/javascript-pass-by-value-function-parameters>)

Published: 2021-03-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kent C. Dodds Blog](<https://devfeed.tech/sources/kent-c-dodds-blog.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [function](<https://devfeed.tech/topics/function.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [variable](<https://devfeed.tech/tags/variable.md>), [variables](<https://devfeed.tech/tags/variables.md>)

### AI overview

This tutorial explains why JavaScript function arguments are passed by value rather than by reference. It uses closures and variable bindings to show why a previously created logger retains an earlier value when the original variable is reassigned.

### Source excerpt

How it works and how to work with it... and around it

## Writable getters

DevFeed: [Writable getters](<https://devfeed.tech/articles/writable-getters-52128.md>)

Original publisher: [Read original article](<https://lea.verou.me/2020/12/writable-getters/>)

Author: Lea Verou

Published: 2020-12-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Lea Verou's blog](<https://devfeed.tech/sources/lea-verou-s-blog.md>)

Topics: [function](<https://devfeed.tech/topics/function.md>), [Closure](<https://devfeed.tech/topics/closure.md>)

Tags: [accessors](<https://devfeed.tech/tags/accessors.md>), [blog](<https://devfeed.tech/tags/blog.md>), [branch](<https://devfeed.tech/tags/branch.md>), [es](<https://devfeed.tech/tags/es.md>), [github](<https://devfeed.tech/tags/github.md>), [id](<https://devfeed.tech/tags/id.md>), [js](<https://devfeed.tech/tags/js.md>), [js-patterns](<https://devfeed.tech/tags/js-patterns.md>), [pattern](<https://devfeed.tech/tags/pattern.md>), [properties](<https://devfeed.tech/tags/properties.md>), [property](<https://devfeed.tech/tags/property.md>), [tutorials](<https://devfeed.tech/tags/tutorials.md>), [use-cases](<https://devfeed.tech/tags/use-cases.md>)

### AI overview

A getter can provide a property's default value from other object properties, but assigning to a getter without a setter does nothing. The article shows a setter that deletes the accessor and replaces it with a data property, plus a `writableGetter()` helper using `Object.defineProperty()`. For cases where assigning a function should replace the computed behavior, variants update the getter instead; one keeps the accessor in place by wrapping static values in a getter. `makeGetterWritable()` adapts an existing object-literal getter by changing its property descriptor. The excerpt also relates the pattern to live and lazy properties and cautions that its ASCII-only slug example is unsuitable for many languages.

### Source excerpt

Setters removing themselves are reminiscent of Ouroboros, the serpent eating its own tail, an ancient symbol. Media credit A pattern that has come up a few times in my code is the following: an object has a property which defaults to an expression based on its other properties unless it's explicitly set, in which case it functions like a normal property. Essentially, the expression functions as a default value. Some examples of use cases: An object where a default id is generated from its name or title, but can also have custom ids. An object with information about a human, where name can be either specified explicitly or generated from firstName and lastName if not specified. An object with parameters for drawing an ellipse, where ry defaults to rx if not explicitly set. An object literal with date information, and a readable property which formats the date, but can be overwritten with a custom human-readable format. An object representing parts of a Github URL (e.g. username, repo, branch) with an apiCall property which can be either customized or generated from the parts (this is actually the example which prompted this blog post) Ok, so now that I convinced you about the utility of this pattern, how do we implement it in JS? Our first attempt may look something like this: let lea = { name: "Lea Verou", get id() { return this.name.toLowerCase().replace(/\W+/g, "-"); } } Note: We are going to use object literals in this post for simplicity, but the same logic applies to variations using Object.create(), or a class Person of which lea is an instance. Our first attempt doesn't quite work as you might expect: lea.id; // "lea-verou" lea.id = "lv"; lea.id; // Still "lea-verou"! Why does this happen? The reason is that the presence of the getter turns the property into an accessor, and thus, it cannot also hold data. If it doesn't have a setter, then simply nothing happens when it is set. However, we can have a setter that, when invoked, deletes the accessor and replace

## JavaScript to Know for React

DevFeed: [JavaScript to Know for React](<https://devfeed.tech/articles/javascript-to-know-for-react-51821.md>)

Original publisher: [Read original article](<https://kentcdodds.com/blog/javascript-to-know-for-react>)

Published: 2020-07-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kent C. Dodds Blog](<https://devfeed.tech/sources/kent-c-dodds-blog.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [React](<https://devfeed.tech/topics/react.md>), [Learning](<https://devfeed.tech/topics/learning.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [destructuring](<https://devfeed.tech/topics/destructuring.md>), [modules](<https://devfeed.tech/topics/modules.md>), [syntax](<https://devfeed.tech/topics/syntax.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [destructuring](<https://devfeed.tech/tags/destructuring.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [learning](<https://devfeed.tech/tags/learning.md>), [modules](<https://devfeed.tech/tags/modules.md>), [react](<https://devfeed.tech/tags/react.md>), [react-hooks](<https://devfeed.tech/tags/react-hooks.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

A tutorial on JavaScript features that developers should learn to work effectively with React, including closures, template literals, arrow functions, destructuring, default parameters, and modules.

### Source excerpt

What JavaScript features you should be familiar with when learning and using React

## Swift Closures in Kotlin Multiplatform - Ben Whitley

DevFeed: [Swift Closures in Kotlin Multiplatform - Ben Whitley](<https://devfeed.tech/articles/swift-closures-in-kotlin-multiplatform-ben-whitley-38323.md>)

Original publisher: [Read original article](<https://touchlab.co/swift-closures-kotlin-multiplatform>)

Published: 2020-06-11T19:11:25Z

Content type: tutorial

Language: en

Sources: [Touchlab](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [cycles](<https://devfeed.tech/tags/cycles.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [swift](<https://devfeed.tech/tags/swift.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial explains how Swift closures are used on the iOS side of Kotlin Multiplatform projects and how they can create strong reference cycles. It describes how Automatic Reference Counting manages memory and why weak references to self may be needed when a closure captures a ViewController.

### Source excerpt

When working on the iOS side of Kotlin Multiplatform, it's helpful to understand Swift closures to update UI and avoid strong reference cycles.

[Next page](<https://devfeed.tech/topics/closure.md?cursor=WyIyMDIwLTA2LTExVDE5OjExOjI1KzAwOjAwIiwgIjI0MjQ3MDI1LWZjZWQtNGMzNy04YjJlLWIyYjIxZDI0NTNlOCJd>)