<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/xakvima02" -->

---
title: DTOs at the Speed of Plain PHP – DerEuroMark | daily.dev
description: php-collective/dto is a code-generation-based DTO library for PHP that avoids runtime reflection overhead. Instead of inspecting class metadata at runtime like...
canonical: https://daily.dev/posts/xakvima02
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: DTOs at the Speed of Plain PHP – DerEuroMark | daily.dev
og:description: php-collective/dto is a code-generation-based DTO library for PHP that avoids runtime reflection overhead. Instead of inspecting class metadata at runtime like...
og:url: https://daily.dev/posts/xakvima02
og:image: https://api.daily.dev/og/posts/xAKVimA02.png
og:image:alt: Post cover image
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.

# DTOs at the Speed of Plain PHP – DerEuroMark

**[PHP Dev](https://daily.dev/sources/phpdev)** · [@damienseguy](https://daily.dev/damienseguy) · 25 upvotes · 1 comments

## Summary

php-collective/dto is a code-generation-based DTO library for PHP that avoids runtime reflection overhead. Instead of inspecting class metadata at runtime like spatie/laravel-data or cuyz/valinor, it generates plain PHP classes from configuration files (XML, YAML, NEON, or PHP). Benchmarks show it is 25-26x faster than reflection-based libraries for object creation, while still only ~2.2x slower than hand-written plain PHP. Key features include mutable/immutable modes, TypeScript type generation, JSON Schema output, field tracking for partial updates, enum support, validation rules, DTO inheritance, array shapes with full type inference, and collection adapters for Laravel, CakePHP, and Doctrine. A practical migration guide walks through incrementally replacing raw arrays with DTOs, starting at API boundaries and moving inward to service layers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.dereuromark.de/2026/03/02/dtos-at-the-speed-of-plain-php/>

## Community discussion

Top comments from developers on daily.dev.

**@brennii96** · 0 upvotes

> Brilliant, always hated the fact that spatie use the term DTO in their documentation when it's doing far too much for it to be a DTO. It's damn near impossible to explain to junior developers that what they're writing aren't DTOs when reputable package maintainers/writers like spatie do shit like that.

## Similar posts on daily.dev

- [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), [#phpstan](https://daily.dev/tags/phpstan)

[View this post on daily.dev](https://daily.dev/posts/xakvima02)

```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":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/xakvima02","headline":"DTOs at the Speed of Plain PHP – DerEuroMark","text":"Shared: DTOs at the Speed of Plain PHP – DerEuroMark","url":"https://daily.dev/posts/xakvima02","datePublished":"2026-03-03T21:08:30.539Z","dateModified":"2026-03-03T21:09:18.098Z","author":{"@type":"Person","name":"Damien seguy","url":"https://daily.dev/damienseguy","image":"https://media.daily.dev/image/upload/s--nPbjKqol--/f_auto,q_auto/v1698422671/avatars/avatar_G85JhYcDxAg024Omc8Rlp","description":"PHP developer passionate about deep language knowledge, testing, static analysis, and sustainable it","worksFor":{"@type":"Organization","name":"Exakat","logo":"https://media.daily.dev/image/upload/s--ibtl6fze--/f_auto/v1749051132/companies/exakat"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":43140}},"image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":25},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"sharedContent":{"@type":"WebPage","url":"https://api.daily.dev/r/96WsjIVuQ"},"comment":[{"@type":"Comment","text":"Brilliant, always hated the fact that spatie use the term DTO in their documentation when it’s doing far too much for it to be a DTO. It’s damn near impossible to explain to junior developers that what they’re writing aren’t DTOs when reputable package maintainers/writers like spatie do shit like that.","datePublished":"2026-03-09T10:01:47.301Z","url":"https://daily.dev/posts/xAKVimA02#c-eKsYhOol8","author":{"@type":"Person","name":"Brendan","url":"https://daily.dev/brennii96","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/phpdev","name":"PHP Dev"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PHP Dev","item":"https://daily.dev/squads/phpdev"},{"@type":"ListItem","position":3,"name":"DTOs at the Speed of Plain PHP – DerEuroMark"}]}
```

