# extension property

An extension property is a Kotlin extension form that makes new properties accessible on existing classes or interfaces without inheritance.

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

## Readonly Property Defaults in PHP 8.6: A Four-Year-Old Restriction Finally Lifts

DevFeed: [Readonly Property Defaults in PHP 8.6: A Four-Year-Old Restriction Finally Lifts](<https://devfeed.tech/articles/readonly-property-defaults-in-php-8-6-a-four-year-old-restriction-finally-lifts-85150.md>)

Original publisher: [Read original article](<https://freek.dev/3204-readonly-property-defaults-in-php-86-a-four-year-old-restriction-finally-lifts>)

Author: Freek Van der Herten (freek@spatie.be)

Published: 2026-10-12T10:30:50Z

Content type: article

Language: en

Sources: [Freek](<https://devfeed.tech/sources/freek-dev-all-blogposts.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [extension property](<https://devfeed.tech/topics/extension-property.md>)

Tags: [php](<https://devfeed.tech/tags/php.md>), [php-8-6](<https://devfeed.tech/tags/php-8-6.md>), [php8](<https://devfeed.tech/tags/php8.md>), [property](<https://devfeed.tech/tags/property.md>), [readonly](<https://devfeed.tech/tags/readonly.md>), [rfc](<https://devfeed.tech/tags/rfc.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

An overview of PHP 8.6's readonly property defaults RFC, including the reason for the previous restriction, the role of interface properties in revisiting it, and practical edge cases.

### Source excerpt

A clear overview of PHP 8.6's readonly property defaults RFC, why the old restriction existed, and why interface properties made it worth revisiting. It also covers the practical edge cases, so you know where the new syntax helps and where it still does not. Read more

## The Evolution of Statics: Say Goodbye to Kotlin Companion Objects?

DevFeed: [The Evolution of Statics: Say Goodbye to Kotlin Companion Objects?](<https://devfeed.tech/articles/the-evolution-of-statics-say-goodbye-to-kotlin-companion-objects-85014.md>)

Original publisher: [Read original article](<https://proandroiddev.com/the-evolution-of-statics-say-goodbye-to-kotlin-companion-objects-dbe625b92896?source=rss-711ab22c5c77------2>)

Author: Nav Singh

Published: 2026-10-11T02:28:53Z

Content type: tutorial

Language: en

Sources: [Nav Singh](<https://devfeed.tech/sources/stories-by-nav-singh-on-medium.md>)

Topics: [extension property](<https://devfeed.tech/topics/extension-property.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [class](<https://devfeed.tech/topics/class.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [interface implementation](<https://devfeed.tech/topics/interface-implementation.md>)

Tags: [androiddev](<https://devfeed.tech/tags/androiddev.md>), [block](<https://devfeed.tech/tags/block.md>), [blocks](<https://devfeed.tech/tags/blocks.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [companion](<https://devfeed.tech/tags/companion.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [cross](<https://devfeed.tech/tags/cross.md>), [extension](<https://devfeed.tech/tags/extension.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [factory](<https://devfeed.tech/tags/factory.md>), [implement](<https://devfeed.tech/tags/implement.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interop](<https://devfeed.tech/tags/interop.md>), [java](<https://devfeed.tech/tags/java.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [memory](<https://devfeed.tech/tags/memory.md>), [module](<https://devfeed.tech/tags/module.md>), [new-features](<https://devfeed.tech/tags/new-features.md>), [overhead](<https://devfeed.tech/tags/overhead.md>), [static](<https://devfeed.tech/tags/static.md>)

### AI overview

The excerpt presents Kotlin 2.5.0-Beta1 companion blocks and companion extensions as experimental alternatives to companion objects. Companion blocks compile members directly as static bytecode on the parent class, allowing Java calls such as `User.createDefault()` without `@JvmStatic`; unlike companion objects, they cannot implement interfaces because they are not objects. Companion extensions add static-like members to a type from outside its declaration, with examples including third-party factories, configuration initializers, and domain constants; regular extension functions instead operate on instances. Trying the preview requires the JetBrains Bootstrap Repository, Kotlin 2.5.0-Beta1, JVM toolchain 21, and the `-Xcompanion-blocks` and `-Xcompanion-blocks-and-extensions` compiler flags.

### Source excerpt

AI generated image For years, we used companion object to group class-level members (constants, factory methods). However, companion objects are actual object singletons under the hood. This introduces memory overhead and causes friction when interoperating with Java (requiring @JvmStaticannotations). data class User(val name: String, val age: Int) { companion object { @JvmStatic fun createDefault(): User = User("Guest", 18) } }AI generated imageKotlin 2.5 introduces companion blocks and companion extensions: Companion Blocks: Drop the object keyword. On the JVM, they compile down directly into high-performance native static members. Companion Extensions: Let us attach new static-like methods or properties to any class from the outside, even classes inside external dependencies or standard Java SDKs we don't control. Companion Blocks vs. Companion Objects Under the Hood: A companion object creates a nested singleton subclass instantiation. A companion block compiles directly to static bytecode members on the parent class. Interface Limitation: Companion objects are still required if static-scoped layer needs to implement an interface. Companion blocks cannot implement interfaces because they are not real objects. Java Interop: Java code can call companion block members directly via User.createDefault(). Companion objects still require User.Companion.createDefault() unless decorated with @JvmStatic. Companion Extensions vs. Regular Extension Functions Call Site: Regular extensions require an existing instance (userInstance.isValid()). Companion extensions are invoked statically on the type itself (User.systemAdmin()). Use Cases: Regular extensions add instance operations (mapping, filtering, etc.). Companion extensions serve as third-party factories, cross-module configuration initializers, or domain constants. Implementation🛠 Setting Up the project Companion Blocks and Extensions are arriving as experimental features in Kotlin 2.5.0-Beta1 To try this out today, we

## Simplify Sorted-Order Validation with Kotlin 2.4.0's New Extensions

DevFeed: [Simplify Sorted-Order Validation with Kotlin 2.4.0's New Extensions](<https://devfeed.tech/articles/simplify-sorted-order-validation-with-kotlin-2-4-0-s-new-extensions-25978.md>)

Original publisher: [Read original article](<https://navczydev.medium.com/simplify-sorted-order-validation-with-kotlin-2-4-0s-new-extensions-b48b1ac10521?source=rss-711ab22c5c77------2>)

Author: Nav Singh

Published: 2026-04-06T02:23:40Z

Content type: article

Language: en

Sources: [Nav Singh](<https://devfeed.tech/sources/stories-by-nav-singh-on-medium.md>)

Topics: [Sorting](<https://devfeed.tech/topics/sorting.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [extension property](<https://devfeed.tech/topics/extension-property.md>)

Tags: [extension](<https://devfeed.tech/tags/extension.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-beginners](<https://devfeed.tech/tags/kotlin-beginners.md>), [kotlin-standard-library](<https://devfeed.tech/tags/kotlin-standard-library.md>), [sortedlist](<https://devfeed.tech/tags/sortedlist.md>), [sorting](<https://devfeed.tech/tags/sorting.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>)

### AI overview

Kotlin 2.4.0-Beta1 adds standard-library extensions for checking whether a collection is sorted without sorting it: `isSorted()`, `isSortedDescending()`, `isSortedWith(comparator)`, `isSortedBy(selector)`, and `isSortedByDescending(selector)`. They return true when elements follow the expected order or the collection has fewer than two elements, and stop at the first out-of-order pair. The supplied excerpt gives no further implementation details.

### Source excerpt

Image generated using Perplexity Kotlin 2.4.0-Beta1 introduces a small but powerful addition to the standard library: a set of new extension functions that lets us check whether a collection is already sorted. With these extension functions, we can check whether elements have already been sorted without resorting them. New Functions .isSorted() .isSortedDescending() .isSortedWith(comparator) .isSortedBy(selector) .isSortedByDescending(selector) All of these return true if: The elements are in the expected order, or The collection has fewer than two elements.These functions are optimized -- they stop checking as soon as an unordered pair is found, so they handle large inputs efficiently.Code samplesdata class User(val name: String, val age: Int)fun main() { val numbers = listOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) println("Numbers: isSorted") println(numbers.isSorted()) // true println("Is sorted descending") println(numbers.isSortedDescending()) // false // Users list val users = listOf( User("Alice", 21), User("Balley", 34), User("Charles", 29), ) println("Users: isSorted by Age") println(users.isSortedBy(User::age)) // false val comparator = Comparator<User>{ user, user2 -> user.name.length.compareTo(user2.name.length) } println("Users: isSortedWith(comparator)") val sortedList = users.sortedWith(comparator) println("Users: Name by length ${sortedList.joinToString()}") // Output: Users: Name by length User(name=Bob, age=31), User(name=Alice, age=24), User(name=Charlie, age=29) println(sortedList.isSortedWith(comparator)) // true }References What's new in Kotlin 2.4.0-Beta1 | Kotlin

## Repository updates June 12th 2024

DevFeed: [Repository updates June 12th 2024](<https://devfeed.tech/articles/repository-updates-june-12th-2024-73083.md>)

Original publisher: [Read original article](<https://github.blog/changelog/2024-06-12-repository-updates-june-12th-2024>)

Author: Allison

Published: 2024-06-12T17:24:52Z

Content type: release

Language: en

Sources: [GitHub Changelog](<https://devfeed.tech/sources/github-changelog.md>)

Topics: [extension property](<https://devfeed.tech/topics/extension-property.md>), [branch protection rules](<https://devfeed.tech/topics/branch-protection-rules.md>), [Push Notifications](<https://devfeed.tech/topics/push-notifications.md>)

Tags: [custom-properties](<https://devfeed.tech/tags/custom-properties.md>), [repository-rules](<https://devfeed.tech/tags/repository-rules.md>), [updates](<https://devfeed.tech/tags/updates.md>), [visibility](<https://devfeed.tech/tags/visibility.md>)

### AI overview

GitHub added multi-select and true/false custom property types, plus targeting by repository visibility, fork status, and primary language. It also expanded the push rules public beta with delegated bypass requests that contributors can submit for bypass list members to review and approve or deny.

### Source excerpt

We're excited to introduce enhancements to custom properties as well as updates to the push rule public beta. Custom properties updates! New property types Multi select allows a repo to...

## Keep your interfaces simple

DevFeed: [Keep your interfaces simple](<https://devfeed.tech/articles/keep-your-interfaces-simple-25892.md>)

Original publisher: [Read original article](<https://proandroiddev.com/keep-your-interfaces-simple-e025d515e3b9?source=rss-1331e67af4e1------2>)

Author: Danny Preussler

Published: 2020-07-16T07:56:26Z

Content type: article

Language: en

Sources: [Danny Preussler](<https://devfeed.tech/sources/stories-by-danny-preussler-on-medium.md>)

Topics: [extension property](<https://devfeed.tech/topics/extension-property.md>), [interface](<https://devfeed.tech/topics/interface.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [hashCode](<https://devfeed.tech/topics/hashcode.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [api](<https://devfeed.tech/tags/api.md>), [avoid](<https://devfeed.tech/tags/avoid.md>), [extension](<https://devfeed.tech/tags/extension.md>), [feature-flags](<https://devfeed.tech/tags/feature-flags.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [simple](<https://devfeed.tech/tags/simple.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

Convenience methods can create hidden contracts that every implementation must honor. The article illustrates this with `isEnabled` and `isDisabled`: adding both to `AppFeatures` makes their opposite results a contract that mocks may not enforce, so switching methods can break tests even when behavior was meant to stay the same. A default interface implementation of `isDisabled` does not solve this for Mockito Kotlin, because the mock may return the default `false` instead of running that implementation. The proposed alternative is a Kotlin extension function, `AppFeatures.isDisabled(feature) = isEnabled(feature).not()`: it keeps the interface small, derives the result from the existing method, and requires no added implementation from fakes or mocks. The excerpt also cites the `equals`/`hashCode` contract as another example of coupled API methods.

### Source excerpt

Avoiding implicit connections and learn how extension functions can help you writing good APIshttps://unsplash.com/photos/xxeAftHHq6E Writing your classes with a good API is hard but important. As the writer is trying to make it easy for the user, we sometimes tend to repeat ourselves by adding convenient methods. Think about the List interface in Java. To check if there are no elements in the list we could check list.getLength() == 0 or we simply ask for isEmpty(). The 2nd one reads much better. But it also adds a duplication and implicit connection between the two: If the list is empty, it can't contain any elements! This must be respected by every implementer of the interface! We can easily think of many other methods with implicit dependencies. Think about how hashCode and equals have a connection. This is stated in the Javadocs: Note that it is generally necessary to override the hashCode method whenever equals is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes. This is a pitfall that can be difficult to avoid and can lead to issues elsewhere that are difficult to track down and fix. Nowadays we have tools to validate this contract, or even better, to generate the implementation. Another example: feature flags A lot of developers work with features flags. These enable us to release continuously without the need for long-lived feature branches. Let's say we have an interface like this: interface AppFeatures { fun isEnabled(feature: Feature): Boolean } When using this I realized I often write code like: if (!isEnabled(Feature.SomeFeature)) "not is enabled" does not read nicely though. But I want the reader to understand my code without thinking too much. Therefore my initial thought was to add another method to the interface fun isDisabled(feature: Feature): Boolean But I realized, doing this might break a lot of tests that simply mock the interface: val appFeatures = mock<AppF

## An Introduction to Inline Classes

DevFeed: [An Introduction to Inline Classes](<https://devfeed.tech/articles/an-introduction-to-inline-classes-25039.md>)

Original publisher: [Read original article](<https://typealias.com/guides/introduction-to-inline-classes/>)

Author: author@typealias.com (Dave Leeds)

Published: 2018-08-28T05:00:01Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [extension property](<https://devfeed.tech/topics/extension-property.md>)

Tags: [apps](<https://devfeed.tech/tags/apps.md>), [classes](<https://devfeed.tech/tags/classes.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [code](<https://devfeed.tech/tags/code.md>), [data](<https://devfeed.tech/tags/data.md>), [data-types](<https://devfeed.tech/tags/data-types.md>), [fast](<https://devfeed.tech/tags/fast.md>), [feature](<https://devfeed.tech/tags/feature.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [performance](<https://devfeed.tech/tags/performance.md>), [phones](<https://devfeed.tech/tags/phones.md>), [processes](<https://devfeed.tech/tags/processes.md>), [programming](<https://devfeed.tech/tags/programming.md>), [series](<https://devfeed.tech/tags/series.md>), [trade](<https://devfeed.tech/tags/trade.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

Kotlin inline classes are introduced as a way to create strongly typed values without giving up performance. The excerpt motivates them with a mail scheduler that accepts an integer delay but does not reveal whether it means days, hours, minutes, seconds, or milliseconds; naming the parameter with its unit helps, but relies on developers to follow the hint. The proposed improvement is a strong type that lets the compiler enforce the expected unit. The excerpt does not explain implementation details or the trade-offs of using inline classes.

### Source excerpt

Whether you're writing massive data-chomping processes that run in the cloud, or mobile apps that run on low-powered cell phones, most of us want our code to run fast. And now, Kotlin's inline classes feature allows us to create the data types that we want without giving up the performance that we need! In this series, we're going to take a look at inline classes from top to bottom! This article explores what they are, how they work, and the trade-offs involved when choosing to use them.