From:             mac30 at narod dot ru
Operating system: linux - kernel 2.6
PHP version:      4.4.2
PHP Bug Type:     Feature/Change Request
Bug description:  similar_text parameters aren't convertible

Description:
------------
Hi! I have some problems with similar_text() function.
In most cases using similar_text(s1,s2) and similar_text(s2,s1) I get the
same results. For example:

(format: s1-first_string, s2-second_string,
  similar_text(s1,s2) (percents%)
  similar_text(s2,s1) (percents%)

ziga piekierski      1 (14.3%), 1 (14.3%)
sadlowski piekierski 3 (31.6%), 3 (31.6%),
ogorek piekierski    2 (25.0%), 2 (25.0%)
majeski piekierski   4 (47.1%), 4 (47.1%),

They gives the same results regardless I use s1,s2 or s2,s1. But in some
case I gets different results and I don't know why:

natujeszczak piekierski 2 (18.2%), 3 (27.3%)
andrzejewski piekierski 5 (45.5%), 4 (36.4%) 
michaelski pankanin     3 (33.3%), 1 (11.1%)
cegielski pankanin      2 (23.5%), 1 (11.8%)

I used PHP 4.4.0 and 5.0.5 and got exactly the same results on both of
them.

I find similar_text function very useful and that's a pity it's not
reliable, because I don't know which value (of the two) is correct.

Using LCS function (taken from comments on similar_text manual page) I was
always getting the same results for (s1,s2) and (s2,s1) - always the higher
value of similar_text(s1,s2) and similar_text(s2,s1)

Best Regards
Maciej



-- 
Edit bug report at http://bugs.php.net/?id=36261&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36261&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36261&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36261&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36261&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36261&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36261&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36261&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36261&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36261&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36261&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36261&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36261&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36261&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36261&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36261&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36261&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36261&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36261&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36261&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36261&r=mysqlcfg

Reply via email to