---
title: "lint/php-8.2"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Upgrade to PHP 8.2: code a newer PHP removes, deprecates or does better.

**[add-skip-dots-flag](/docs/rules/lint/php-8-2/add-skip-dots-flag)**

Prior PHP 8.2 FilesystemIterator::SKIP_DOTS was always set and could not be removed, therefore FilesystemIterator::SKIP_DOTS is added in order to keep this behavior

In the `lint-recommended` preset and every stricter one. In Rector's `rector/php82` set. Safe fix. Runs only when `[php] version` is 8.2 or later.

**[no-dollar-brace-interpolation](/docs/rules/lint/php-8-2/no-dollar-brace-interpolation)**

Replace deprecated `${var}` to `{$var}`

In the `lint-recommended` preset and every stricter one. In Rector's `rector/php82` set. Safe fix. Runs only when `[php] version` is 8.2 or later.

**[no-utf8-encode-decode](/docs/rules/lint/php-8-2/no-utf8-encode-decode)**

Change deprecated `utf8_decode()` and `utf8_encode()` to `mb_convert_encoding()`

In the `lint-recommended` preset and every stricter one. In Rector's `rector/php82` set. Safe fix. Runs only when `[php] version` is 8.2 or later.

**[prefer-readonly-class](/docs/rules/lint/php-8-2/prefer-readonly-class)**

Decorate read-only class with `readonly` attribute

In the `lint-strict` preset. In Rector's `rector/php82` set. Unsafe fix: it can change behavior. Runs only when `[php] version` is 8.2 or later.
