Table of Contents

PHP RFC: Deprecations for PHP 8.6

Introduction

The RFC proposes to deprecate the listed functionality in PHP 8.6 and remove it in PHP 9 (except where otherwise noted).

The following list provides a short overview of the functionality targeted for deprecation, while more detailed explanation is provided in the Proposal section:

Proposal

Each feature proposed for deprecation is voted separately and requires a 2/3 majority. All votes refer to deprecation in PHP 8.6 and removal in PHP 9 (except where otherwise noted).

Example Deprecation

Description

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

TODO: Reason to get rid of 'A' ZPP specifier Fallback: get_object_vars()

The recursive version doesn't recursive if a value/property is an object. Due to taking by reference this breaks readonly properties, which is a similar issue that the ArrayObject with backing object deprecation is addressing

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

TODO: Reason to get rid of 'H' ZPP specifier Fallback: get_object_vars()

Passing objects to ArrayObject::exchangeArray()

TODO: Follow-up of 8.5 ArrayObject with objects deprecation https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects

Deprecate strcoll()

TODO:

Deprecate SORT_LOCALE_STRING flag for sort() functions

TODO:

Backward Incompatible Changes

For PHP 8.6 additional deprecation notices will be emitted. The actual removal of the affected functionality will happen no earlier than PHP 9.

Removed from this proposal

The following entries were originally added to this proposal and then dropped.