Edit report at https://bugs.php.net/bug.php?id=60123&edit=1
ID: 60123 Updated by: fel...@php.net Reported by: gravisoft at gmail dot com Summary: Metaphone returns string longer than limit -Status: Open +Status: Bogus Type: Bug Package: Unknown/Other Function Operating System: Windows XP SP3 PHP Version: 5.3.8 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php It isn't an 'string length limit', but the max number of phonemes. X -> KS Previous Comments: ------------------------------------------------------------------------ [2011-10-24 15:43:19] gravisoft at gmail dot com Description: ------------ The metaphone function accepts two parameters: an input string, and a string length limit. With certain input, it is possible to cause metaphone to return a string longer than the specified limit. The issue seems to arise when the string is nearing it's length limit and the following input character is an X, which can translate to a KS, pushing the string over its limit. Test script: --------------- <?php var_dump( metaphone('administratrix', 10) ); var_dump( metaphone('asterix', 5) ); ?> Expected result: ---------------- string(10) "ATMNSTRTRK" string(5) "ASTRK" Actual result: -------------- string(11) "ATMNSTRTRKS" string(6) "ASTRKS" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60123&edit=1