Skip to content
PHP News
Search
Accepted PHP 8.6

Deprecations for PHP 8.6

Deprecates 31 features in PHP 8.6 for removal in PHP 9, including return in finally blocks, is_double() and spl_object_hash().

Deprecate the list() construct?

Primary vote

23 Yes 23 No 1 abstain 50% approval

This poll has closed.

Deprecate returning from a finally block?

  • No 3
  • Yes 39
  • Abstain 4

This poll has closed.

Deprecate using let as an identifier?

  • No 11
  • Yes 24
  • Abstain 9

This poll has closed.

Deprecate using namespace as a class constant name?

  • No 8
  • Yes 29
  • Abstain 7

This poll has closed.

Deprecate using in, out, and inout as identifiers?

  • No 21
  • Yes 8
  • Abstain 15

This poll has closed.

Deprecate using is as an identifier?

  • No 10
  • Yes 29
  • Abstain 6

This poll has closed.

Deprecate the possibility to name a function readonly?

  • No 1
  • Yes 39
  • Abstain 2

This poll has closed.

Deprecate using _ as a constant and compile time alias?

  • No 4
  • Yes 34
  • Abstain 5

This poll has closed.

Deprecate using _ as a function name and the _() function alias for gettext()?

  • No 22
  • Yes 10
  • Abstain 11

This poll has closed.

Passing objects for $array parameter of array_walk() and array_walk_recursive()?

  • No 3
  • Yes 41
  • Abstain 0

This poll has closed.

Passing objects for $options parameter of deflate_init() and inflate_init()?

  • No 4
  • Yes 39
  • Abstain 1

This poll has closed.

Passing objects as parameters to the zlib.inflate and zlib.deflate stream filters?

  • No 4
  • Yes 38
  • Abstain 2

This poll has closed.

Passing objects as parameters to the bzip2.decompress and bzip2.compress stream filters?

  • No 4
  • Yes 38
  • Abstain 2

This poll has closed.

Passing objects for $vars parameter of mb_convert_variables()?

  • No 2
  • Yes 39
  • Abstain 2

This poll has closed.

Passing objects for $data parameter of http_build_query()?

  • No 10
  • Yes 21
  • Abstain 13

This poll has closed.

Deprecate is_double()?

  • No 2
  • Yes 40
  • Abstain 2

This poll has closed.

Deprecate is_integer()?

  • No 2
  • Yes 39
  • Abstain 3

This poll has closed.

Deprecate is_long()?

  • No 2
  • Yes 39
  • Abstain 3

This poll has closed.

Deprecate doubleval()?

  • No 2
  • Yes 38
  • Abstain 4

This poll has closed.

Deprecate define() with $case_insensitive being specified?

  • No 0
  • Yes 41
  • Abstain 3

This poll has closed.

Deprecate is_subclass_of with string when $allow_string is false?

  • No 0
  • Yes 37
  • Abstain 7

This poll has closed.

Deprecate is_a with string when $allow_string is false?

  • No 0
  • Yes 38
  • Abstain 6

This poll has closed.

Deprecate strcoll()?

  • No 2
  • Yes 39
  • Abstain 4

This poll has closed.

Deprecate SORT_LOCALE_STRING flag for sort() functions?

  • No 2
  • Yes 38
  • Abstain 3

This poll has closed.

Deprecate Metaphone Function?

  • No 8
  • Yes 20
  • Abstain 16

This poll has closed.

Deprecate dechunk filter?

  • No 15
  • Yes 18
  • Abstain 12

This poll has closed.

Deprecate ReflectionProperty::setValue() and ReflectionProperty::setRawValue() with wrong types?

  • No 1
  • Yes 43
  • Abstain 2

This poll has closed.

Deprecate ReflectionMethod::invoke() and ReflectionMethod::invokeArgs() with objects for static methods?

  • No 3
  • Yes 39
  • Abstain 1

This poll has closed.

Deprecate ArrayIterator methods that inherit ArrayObject implementation?

  • No 1
  • Yes 42
  • Abstain 0

This poll has closed.

Deprecate spl_classes()?

  • No 0
  • Yes 43
  • Abstain 0

This poll has closed.

Deprecate spl_object_hash()?

  • No 9
  • Yes 26
  • Abstain 11

This poll has closed.

Deprecate SplFileObject CSV methods?

  • No 5
  • Yes 25
  • Abstain 15

This poll has closed.

Deprecate mysqli::stmt_init, mysqli_stmt_init, and mysqli_stmt::__construct without the second argument?

  • No 0
  • Yes 40
  • Abstain 3

This poll has closed.

Deprecate mysqli_get_charset()?

  • No 0
  • Yes 43
  • Abstain 0

This poll has closed.

Deprecate passing a $sessionhandler object to session_set_save_handler() which does not contain the create_sid() and validateId() methods?

  • No 2
  • Yes 26
  • Abstain 14

This poll has closed.

Voting closed on August 10, 2026. 31 of the 35 items cleared two-thirds. The closest pass was passing objects to http_build_query(), at 21 to 10. list() failed on a 23 to 23 tie, in/out/inout went 8 to 21, _() went 10 to 22, and the dechunk filter went 18 to 15.

Summary

The PHP 8.6 deprecations RFC bundled 35 separate proposals, each with its own vote and each needing a two-thirds majority. 31 passed and 4 didn't. Everything that passed emits a deprecation notice in PHP 8.6, with removal no earlier than PHP 9.

What's deprecated

The one most likely to catch a real bug is returning from a finally block. A return there silently throws away any exception the try block raised:

function getConfig(): array {
    try {
        return loadConfig(); // throws if the file is missing
    } finally {
        return []; // the exception is gone, the caller just gets []
    }
}

In PHP 8.6 this triggers Deprecated: Returning from a finally block is deprecated at compile time, so you see it while writing the code rather than in production.

Some of the other items that passed include:

  • is_double(), is_integer(), is_long() and doubleval(), in favor of is_float(), is_int() and floatval()
  • let and is as identifiers, namespace as a class constant name, readonly as a function name, and _ as a constant, all reserved for possible future keywords
  • Passing objects where array_walk(), array_walk_recursive(), http_build_query(), mb_convert_variables(), deflate_init() and inflate_init() expect arrays, plus the same for the zlib and bzip2 stream filters
  • spl_object_hash(), since spl_object_id() returns the same identifier as an integer
  • The SplFileObject CSV methods: fgetcsv(), fputcsv(), setCsvControl() and getCsvControl()
  • strcoll(), the SORT_LOCALE_STRING flag, metaphone(), spl_classes() and mysqli_get_charset()
  • define() with $case_insensitive, and is_a() or is_subclass_of() with a string when $allow_string is false

The full list also covers changes to Reflection, ArrayIterator, mysqli::stmt_init() and session_set_save_handler().

What didn't pass

  • The list() construct, so list($a, $b) = $array stays next to [$a, $b] = $array
  • in, out and inout as identifiers
  • _ as a function name, and _() as the alias for gettext()
  • The dechunk stream filter

What it means for existing code

Nothing breaks in PHP 8.6. You get new deprecation notices, and the code keeps running. The alias deprecations are one-line swaps, like is_double() to is_float(). For most items, the RFC links an impact analysis run against popular Composer packages, so you can see how common each pattern is.

Our coverage