Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ PHP NEWS
. Added the "filter.max_filter_count" stream context option for php://filter
URLs. Using more than 16 filters without configuring this option is now
deprecated. (Sjoerd Langkemper)
. metaphone() is now deprecated. (Weilin Du)
. Improved performance of array_intersect(). (mehmetcansahin)
. Fixed bug GH-23006 (phpcredits() full-page HTML title says phpinfo()).
(Weilin Du)
Expand Down
3 changes: 3 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ PHP 8.6 UPGRADE NOTES
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_arrayiterator_methods_that_inherit_arrayobject_implementation

- Standard:
. metaphone() is deprecated.
Please use a userland phonetic matching library instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_metaphone_function
. Using more than 16 filters in a php://filter URL without configuring the
"filter.max_filter_count" stream context option now emits an E_DEPRECATED
warning. Use stream_filter_append() or configure this option explicitly.
Expand Down
1 change: 1 addition & 0 deletions ext/standard/basic_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,7 @@ function inet_pton(string $ip): string|false {}
/* metaphone.c */

/** @refcount 1 */
#[\Deprecated(since: '8.6', message: 'use a userland phonetic matching library instead')]
function metaphone(string $string, int $max_phonemes = 0): string {}

/* {{{ head.c */
Expand Down
25 changes: 16 additions & 9 deletions ext/standard/basic_functions_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ext/standard/basic_functions_decl.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ext/standard/tests/GHSA-96wq-48vp-hh57.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ metaphone($str, 1);

?>
===DONE===
--EXPECT--
--EXPECTF--
Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
===DONE===
7 changes: 6 additions & 1 deletion ext/standard/tests/strings/bug44242.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ echo metaphone('CMXFXV'), "\n";
echo metaphone('CMXFXZXZ'), "\n";

?>
--EXPECT--
--EXPECTF--
Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
KMKSFKSS

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
KMKSFKSF

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
KMKSFKSSKSS
7 changes: 6 additions & 1 deletion ext/standard/tests/strings/bug47443.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ var_dump(metaphone("scrath"));
var_dump(metaphone("scratc"));

?>
--EXPECT--
--EXPECTF--
Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(4) "SKRX"

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(4) "SKR0"

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(5) "SKRTK"
17 changes: 16 additions & 1 deletion ext/standard/tests/strings/bug48709.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,27 @@ foreach ($exceptions as $letter) {
}

?>
--EXPECT--
--EXPECTF--
Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
kn => N

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
gn => N

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
pn => N

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
ae => E

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
wr => R

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
x => S

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
wh => W

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
wa => W
19 changes: 18 additions & 1 deletion ext/standard/tests/strings/metaphone.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,31 @@ foreach($array as $str) {

echo "Done\n";
?>
--EXPECT--
--EXPECTF--
Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(0) ""

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(0) ""

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(6) "FLTFRS"

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(6) "FLTFRS"

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(26) "0FLFRWRTKRFLNKHTLSLN0KLTR0"

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(56) "BT0XTFHRRHLTNTRTRNTPSNKLWRNRFTBF0MSWPNK0FNRKW0TSFSTLWNKS"

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(69) "ANT0NTWSKNFLYNKBKTMRTRW00SPTF0R0FSRNNTBHNTT0WNTRRTWLFNK0TTMRXSBRNTBLK"

Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(56) "0NKTWSTSFRS0YKLTPRSFNT0TSTNTMNSF0MNTNSWSTPLTW00FTFLMNLFT"
Done
11 changes: 11 additions & 0 deletions ext/standard/tests/strings/metaphone_deprecation.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--TEST--
metaphone() deprecation
--FILE--
<?php

var_dump(metaphone("programming"));

?>
--EXPECTF--
Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d
string(7) "PRKRMNK"
Loading