Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/php-8.0

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

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

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

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

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

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

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

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

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

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

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.

Last updated on

Was this page helpful?