php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48011 levenshtein second variant fails
Submitted: 2009-04-18 10:22 UTC Modified: 2009-04-18 15:09 UTC
From: joris at bonboa dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.2.3-1 OS: Linux (Ubuntu)
Private report: No CVE-ID: None
 [2009-04-18 10:22 UTC] joris at bonboa dot com
Description:
------------
Does de second variant of the levenshtein function actuall work?

The second output line I dig, but not the first.
Any idea?


Reproduce code:
---------------
---
From manual page: function.levenshtein
---
	$i=0;
	$u=0;
	$d=0;
	
	$t1='Joris';
	$t2='oris';
	$l=levenshtein($t1,$t2,$i,$u,$d);
	echo $t1.'='.$t2.'   '.$l.':'.$i.':'.$u.':'.$d."\n";
	$l=levenshtein($t1,$t2);
	echo $t1.'='.$t2.'   '.$l."\n";


Expected result:
----------------
Joris=oris   1:0:0:1
Joris=oris   1


Actual result:
--------------
Joris=oris   0:0:0:0
Joris=oris   1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-18 10:32 UTC] joris at bonboa dot com
My PHP version = 5.2.5
 [2009-04-18 13:00 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-04-18 13:29 UTC] joris at bonboa dot com
Here on a Linux box using PHP 5.2.6-1 same problem
 [2009-04-18 13:31 UTC] joris at bonboa dot com
Here again, Ubuntu and PHP 5.2.3-1, same output (problem)
 [2009-04-18 15:09 UTC] jani@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 23:01:31 2025 UTC