PHP RFC: Deprecations for PHP 8.0
- Date: 2019-07-23
- Status: Draft
The RFC proposes to deprecate the listed functionality in PHP 8.0 and remove it in PHP 9.
The following list provides a short overview of the functionality targeted for deprecation, while more detailed explanation is provided in the Proposal section:
Each feature proposed for deprecation is voted separately and requires a 2/3 majority. All votes refer to deprecation in PHP 8.0 and removal in PHP 9.0.
date_sunrise() and date_sunset()
In favor of
date_sun_info(). Ini settings
date.default_longitude will also be removed once the functions are gone. See https://github.com/php/php-src/pull/4423.
This format is misleading as per the documentation it is actually not compatible with ISO-8601 and
DATE_ATOM should be used instead.
This function is part of the standard library but requires an external dependency (browscap.ini) to work. Moreover, userland implementations are faster than this function. (See user note 122181: http://docs.php.net/manual/en/function.get-browser.php#122181)
nikic: I disagree.
key(), current(), next(), prev(), reset() on objects
Accessing static members on traits
Optional param after required
get_class() without argument
This is rather exotic and is equivalent to using
self::class which are more explicit as the behaviour could be unexpected within a child class (see example 2 from the documentation page) and the expected behaviour is probably
static::class with LSB.
Backward Incompatible Changes
For PHP 8.0 additional deprecation notices will appear. For PHP 9.0 the previously deprecated functionality will no longer be available.