<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk" -->

---
title: Repetition and Insight: What is new in PHPUnit 13.3?
description: PHPUnit 13.3 introduces two major feature areas: flaky test handling and improved code coverage reporting. A revived --repeat option (and #[Repeat] attribute)...
canonical: https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Repetition and Insight: What is new in PHPUnit 13.3? | daily.dev
og:description: PHPUnit 13.3 introduces two major feature areas: flaky test handling and improved code coverage reporting. A revived --repeat option (and #[Repeat] attribute)...
og:url: https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk
og:image: https://api.daily.dev/og/posts/goqQXP1lK.png
og:image:alt: Repetition and Insight: What is new in PHPUnit 13.3?
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.

# Repetition and Insight: What is new in PHPUnit 13.3?

**[PHPUnit Expert](https://daily.dev/sources/phpunit-expert)** · 9 min read · 3 upvotes · 2 comments

## Summary

PHPUnit 13.3 introduces two major feature areas: flaky test handling and improved code coverage reporting. A revived --repeat option (and #[Repeat] attribute) runs individual tests multiple times to surface flakiness, while a new #[Retry] attribute and --retry option let tests be retried automatically, with all retries transparently reported in the test summary. On the coverage side, the HTML report gains a class-oriented view alongside the existing file view, redesigned branch and path coverage visualizations including a control flow graph per method (requiring Graphviz's dot tool), and the ability to filter the entire coverage report by test size (Small/Medium/Large) declared via attributes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://phpunit.expert/articles/repetition-and-insight-what-is-new-in-phpunit-133.html>

## Questions this post answers

### How do I detect flaky tests in PHPUnit 13.3?

Use the new --repeat option or the #[Repeat] attribute to run individual tests multiple times back to back. For example, --repeat 100 runs every eligible test up to one hundred times, skipping remaining repetitions once a failure occurs, and each repetition is labeled in the output as (repetition N of M). Only void-returning tests without #[Depends] can be repeated.

_Developers hunting down intermittent test failures can follow PHPUnit release coverage like this on daily.dev._

### What does the #[Retry] attribute do in PHPUnit 13.3?

The #[Retry(3)] attribute reruns a test up to three times, and the first attempt that is not a failure or error decides the result. Every attempt uses a fresh test class instance, an attribute takes precedence over the --retry command-line option, and any test that only passed after retries is unconditionally listed in the run summary along with its failed attempt count.

_Teams deciding how to tolerate unreliable CI tests can track changes like this via daily.dev._

### What is new in the PHPUnit code coverage HTML report for viewing coverage by class instead of file?

PHPUnit 13.3 adds a class-oriented view alongside the existing file view in the HTML coverage report, organizing coverage by namespaces and classes rather than directories and files. Each class gets its own page with metrics, CRAP index per method, and annotated source restricted to that class's lines, including sections for used traits and inherited methods; it can be disabled with --without-class-view.

_Anyone weighing new PHPUnit coverage tooling against existing workflows can follow updates like this on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@leonidbugaev** · 0 upvotes

> The #[Retry] summary is honest, but CI still went green on attempt 2. I'd use --repeat when I actually want the flake to fail the job. A 30% race that only shows up in the footer still ships.

**@agustinbarrientos** · 0 upvotes

> Can the class view jump straight to the uncovered trait methods? I'd rather not bounce between files to find them.

## Similar posts on daily.dev

- [Precision and Clarity: What is New in PHPUnit 13.2?](https://daily.dev/posts/precision-and-clarity-what-is-new-in-phpunit-13-2--aparnuw4v) · PHPUnit Expert · 0 upvotes · 0 comments
- [Closures, Clarity, and Control: What is New in PHPUnit 13.1?](https://daily.dev/posts/closures-clarity-and-control-what-is-new-in-phpunit-13-1--srogvd91u) · PHPUnit Expert · 2 upvotes · 0 comments
- [UnitTest Attribute and More in Laravel 13.3.0](https://daily.dev/posts/unittest-attribute-and-more-in-laravel-13-3-0-t6ccxev8j) · Laravel News · 15 upvotes · 0 comments
- [Leaner, steadier PHPUnit runs for upcoming releases](https://daily.dev/posts/leaner-steadier-phpunit-runs-for-upcoming-releases-ttpmkxduo) · Make WordPress Core · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk)

```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":"Repetition and Insight: What is new in PHPUnit 13.3?","url":"https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk"},"datePublished":"2026-09-09T04:11:46.058Z","dateModified":"2026-09-14T08:40:21.414Z","description":"PHPUnit 13.3 introduces two major feature areas: flaky test handling and improved code coverage reporting. A revived --repeat option (and #[Repeat] attribute)...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/eba2f7504f67f3affde75f4887681ba2?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/eba2f7504f67f3affde75f4887681ba2?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"PHPUnit Expert","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":"PHPUnit Expert","logo":"https://media.daily.dev/image/upload/s--FMZoysoG--/f_auto,q_auto/v1774964057/logos/phpunit-expert?_a=BAMAMiWQ0","url":"https://daily.dev/sources/phpunit-expert"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"testing,php,phpunit","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PHPUnit Expert","item":"https://daily.dev/sources/phpunit-expert"},{"@type":"ListItem","position":3,"name":"Repetition and Insight: What is new in PHPUnit 13.3?"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk","comment":[{"@type":"Comment","text":"The #[Retry] summary is honest, but CI still went green on attempt 2. I’d use --repeat when I actually want the flake to fail the job. A 30% race that only shows up in the footer still ships.","datePublished":"2026-09-09T06:59:31.061Z","url":"https://daily.dev/posts/goqQXP1lK#c-DQH6qXaMv","author":{"@type":"Person","name":"Leonid Bugaev","url":"https://daily.dev/leonidbugaev","image":"https://lh3.googleusercontent.com/a/ACg8ocLhMgurwTmJElWaH9A8Ju8cHvZxgMCDt009jEYkmFCyUGAoaGSw=s96-c"}},{"@type":"Comment","text":"Can the class view jump straight to the uncovered trait methods? I’d rather not bounce between files to find them.","datePublished":"2026-09-19T15:38:14.291Z","url":"https://daily.dev/posts/goqQXP1lK#c-yslsGosNW","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/repetition-and-insight-what-is-new-in-phpunit-13-3--goqqxp1lk#faq","mainEntity":[{"@type":"Question","name":"How do I detect flaky tests in PHPUnit 13.3?","acceptedAnswer":{"@type":"Answer","text":"Use the new --repeat option or the #[Repeat] attribute to run individual tests multiple times back to back. For example, --repeat 100 runs every eligible test up to one hundred times, skipping remaining repetitions once a failure occurs, and each repetition is labeled in the output as (repetition N of M). Only void-returning tests without #[Depends] can be repeated. Developers hunting down intermittent test failures can follow PHPUnit release coverage like this on daily.dev."}},{"@type":"Question","name":"What does the #[Retry] attribute do in PHPUnit 13.3?","acceptedAnswer":{"@type":"Answer","text":"The #[Retry(3)] attribute reruns a test up to three times, and the first attempt that is not a failure or error decides the result. Every attempt uses a fresh test class instance, an attribute takes precedence over the --retry command-line option, and any test that only passed after retries is unconditionally listed in the run summary along with its failed attempt count. Teams deciding how to tolerate unreliable CI tests can track changes like this via daily.dev."}},{"@type":"Question","name":"What is new in the PHPUnit code coverage HTML report for viewing coverage by class instead of file?","acceptedAnswer":{"@type":"Answer","text":"PHPUnit 13.3 adds a class-oriented view alongside the existing file view in the HTML coverage report, organizing coverage by namespaces and classes rather than directories and files. Each class gets its own page with metrics, CRAP index per method, and annotated source restricted to that class's lines, including sections for used traits and inherited methods; it can be disabled with --without-class-view. Anyone weighing new PHPUnit coverage tooling against existing workflows can follow updates like this on daily.dev."}}]}
```

