This is an old revision of the document!
PHP RFC: Deprecations for PHP 7.3
- Date: 2017-08-02
- Author: Nikita Popov nikic@php.net
- Status: Draft
Introduction
This is a draft RFC for multiple deprecations targeting PHP 7.3. The RFC proposes to deprecate the listed functionality in PHP 7.3 and remove it no later than in PHP 8.0.
The following list provides a short overview of the functionality targeted for deprecation, while more detailed explanation is provided in the Proposal section:
- Undocumented mbstring function aliases
mb_detect_encoding
without strict modestrip_tags()
andfgetss()
functions
Proposal
Each feature proposed for deprecation is voted separately. Each vote requires a 2/3 majority, independently of whether it is a language or standard library change. All votes refer to deprecation in PHP 7.3 and removal in the next major version (presumably PHP 8.0).
Undocumented mbstring function aliases
The functions mbregex_encoding
, mbereg
, mberegi
, mbereg_replace
, mberegi_replace
, mbsplit
, mbereg_match
, mbereg_search
, mbereg_search_pos
, mbereg_search_regs
, mbereg_search_init
, mbereg_search_getregs
, mbereg_search_getpos
and mbereg_search_setpos
are undocumented aliases of the same functions using an mb_
prefix (e.g., mb_ereg
).
Proposed action: Mark the functions as deprecated, so that a deprecation notice is emitted on every call.
mb_detect_encoding() without strict mode
TODO
strip_tags() and fgetss() functions
TODO
From some preliminary feedback: We might want to only deprecate the insecure allowed_tags parameter, but keep the “strip all tags” functionality. This function appears to be useful as a relatively simple way of reusing code that outputs HTML in a different context (CLI output, text messages, etc.)
strpos() with integer needle
TODO
Argument-less continue inside switch
TODO
(Confusing behavior for people coming from other languages, most likely mean “continue 2”)
Backward Incompatible Changes
For PHP 7.3 additional deprecation notices will appear. For PHP 8.0 the previously deprecated functionality will no longer be available.
Proposed Voting Choices
Each of the bullet points above will get a separate vote. All votes will require a 2/3 supermajority, independently of whether they are language changes or not.
Patches and Tests
The patches for these deprecations are for the most part trivial, as such they will be provided once the RFC is accepted (or portions of it).