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

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

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

**[no-int-get-headers-format](/docs/rules/lint/php-8-0/no-int-get-headers-format)**

Change the integer associative argument of the get_headers() function to a boolean

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

**[no-unused-catch-variable](/docs/rules/lint/php-8-0/no-unused-catch-variable)**

Remove unused variable in `catch()`

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

**[no-version-compare-operator-alias](/docs/rules/lint/php-8-0/no-version-compare-operator-alias)**

Streamline the operator argument of the version_compare() function

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

**[prefer-get-debug-type](/docs/rules/lint/php-8-0/prefer-get-debug-type)**

Change ternary type resolve to get_debug_type()

In the `lint-strict` preset. In Rector's `rector/php-polyfills`, `rector/php80` sets. Unsafe fix: it can change behavior. Runs only when `[php] version` is 8.0 or later.

**[prefer-match](/docs/rules/lint/php-8-0/prefer-match)**

Change `switch()` to `match()`

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

**[prefer-nullsafe-over-ternary](/docs/rules/lint/php-8-0/prefer-nullsafe-over-ternary)**

Change null check ternary around a method call or property fetch to nullsafe operator

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

**[prefer-static-class](/docs/rules/lint/php-8-0/prefer-static-class)**

Change $this::class to static::class or self::class depends on class modifier

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

**[prefer-str-contains-over-mb-strpos](/docs/rules/lint/php-8-0/prefer-str-contains-over-mb-strpos)**

Replace mb_strpos() !== false and mb_strstr()  with str_contains()

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

**[prefer-str-ends-with](/docs/rules/lint/php-8-0/prefer-str-ends-with)**

Change helper functions to `str_ends_with()`

In the `lint-strict` preset. In Rector's `rector/php-polyfills`, `rector/php80` sets. Unsafe fix: it can change behavior. Runs only when `[php] version` is 8.0 or later.

**[prefer-str-starts-with](/docs/rules/lint/php-8-0/prefer-str-starts-with)**

Change helper functions to str_starts_with()

In the `lint-strict` preset. In Rector's `rector/php-polyfills`, `rector/php80` sets. Unsafe fix: it can change behavior. Runs only when `[php] version` is 8.0 or later.
