====== PHP RFC: Deprecate Metaphone Function ======
* Version: 1.0
* Date: 2026-04-25
* Author: Weilin Du, lamentxu@163.com
* Status: Under Discussion
* Implementation: TBD
===== Introduction =====
This RFC proposes the deprecation of the metaphone function in PHP 8.6
The metaphone function calculates the metaphone key of a string. The original Metaphone algorithm was published in 1990. However, it has significant limitations:
* It is strictly limited to English pronunciation rules.
* It has been superseded by more accurate algorithms, namely Double Metaphone (1999) and Metaphone 3 (2009).
Currently, PHP core maintains the oldest and least accurate version of this algorithm in C. Since phonetic algorithms are language-specific and frequently updated, they are better suited for userland implementation. There are already robust and actively maintained userland libraries available via Composer that implement Double Metaphone and Metaphone 3.
Maintaining this legacy function in the core provides little value to modern PHP applications, and therefore this RFC proposed to deprecate this function in the next PHP 8.x version (which is PHP 8.6)
Note: In the same reason, it is also reasonable to deprecate soundex. However, soundex is widely supported by SQLs so its deprecation might cause bigger impact.
===== Proposal =====
Deprecate the metaphone function in PHP 8.6. Calling the function will emit an E_DEPRECATED notice.
$key = metaphone('hello world');
// Deprecated: Function metaphone() is deprecated since PHP 8.6
===== Backward Incompatible Changes =====
Applications calling metaphone() will encounter E_DEPRECATED notices. Developers are advised to migrate to userland phonetic algorithm libraries or use soundex() if strict backward compatibility with core functions is preferred (though userland is highly recommended).
===== Proposed PHP Version(s) =====
PHP 8.6
===== Voting Choices =====
----
Primary Vote requiring a 2/3 majority to accept the RFC:
* Yes
* No
* Abstain
===== Patches and Tests =====
TBD
===== Implementation =====
TBD
===== Changelog =====
2026/4/25 initial update