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

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

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

**[no-call-user-method](/docs/rules/lint/php-7-0/no-call-user-method)**

Changes call_user_method()/call_user_method_array() to call_user_func()/call_user_func_array()

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

**[no-list-from-string](/docs/rules/lint/php-7-0/no-list-from-string)**

list() cannot split string directly anymore, use str_split()

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

**[prefer-braced-variable-variable](/docs/rules/lint/php-7-0/prefer-braced-variable-variable)**

Ensure variable variables are wrapped in curly braces

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

**[prefer-coalesce-return](/docs/rules/lint/php-7-0/prefer-coalesce-return)**

Change `if` with `isset` and `return` to coalesce

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

**[prefer-random-int](/docs/rules/lint/php-7-0/prefer-random-int)**

Changes rand, srand, and getrandmax to newer alternatives

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

**[prefer-spaceship](/docs/rules/lint/php-7-0/prefer-spaceship)**

Use &lt;=> spaceship instead of ternary with same effect

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

**[prefer-spaceship-return](/docs/rules/lint/php-7-0/prefer-spaceship-return)**

Changes if/else to spaceship &lt;=> where useful

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

**[prefer-static-method-call](/docs/rules/lint/php-7-0/prefer-static-method-call)**

Changes $this->call() to static method to static call

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

**[prefer-throwable-handler](/docs/rules/lint/php-7-0/prefer-throwable-handler)**

Change typehint from `Exception` to `Throwable`

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

**[prefer-time](/docs/rules/lint/php-7-0/prefer-time)**

Renames mktime() without arguments to time()

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