PHP Missing Methods & Levenshtein Distance

I’m just going to leave this nifty little PHP snippet here, and recommend against it’s use. It could very well be shorter and more concise, probably a bit more performant too, but it works:

View the code on Gist.

It also encourages bad practices and ambiguity ( should elngth be mapped on to length1 or length2? If you’re willing to run levenshtein in your head, maybe you should spell correctly ).

Inspired by this tweet:

5 thoughts on “PHP Missing Methods & Levenshtein Distance

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.