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

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

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

**[add-const-type](/docs/rules/lint/php-8-3/add-const-type)**

Add type to constants based on their value

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

**[prefer-dynamic-class-constant](/docs/rules/lint/php-8-3/prefer-dynamic-class-constant)**

constant(Example::class . '::' . $constName) to dynamic class const fetch Example::&#123;$constName&#125;

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

**[prefer-json-validate](/docs/rules/lint/php-8-3/prefer-json-validate)**

Replace json_decode($json, true) !== null &amp;&amp; json_last_error() === JSON_ERROR_NONE  with json_validate()

In the `lint-recommended` preset and every stricter one. In Rector's `rector/php-polyfills`, `rector/php83` sets. Safe fix. Runs only when `[php] version` is 8.3 or later.

**[prefer-ldap-uri](/docs/rules/lint/php-8-3/prefer-ldap-uri)**

Combine separated host and port on ldap_connect() args

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

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

Decorate read-only anonymous class with `readonly` attribute

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

**[prefer-self-class](/docs/rules/lint/php-8-3/prefer-self-class)**

Replace calls to `get_class()` and `get_parent_class()` without arguments with `self::class` and `parent::class`

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