3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pages = array('index', 'login', 'pricing', 'documentation', 'support', 'signup'); $cleanpage = "index0.html"; $similar = array(); $levenshtein = array(); $soundex = array(); foreach ($pages as $key => $page) { $similar[$page] = similar_text($cleanpage, $page); $levenshtein[$page] = levenshtein($cleanpage, $page); $soundex[$page] = abs(soundex($cleanpage) - soundex($page)); } print_r($similar); print_r($levenshtein); print_r($soundex); ?>
based on k7UCY
Output for 7.1.0
Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Warning: A non-numeric value encountered in /in/h7pmW on line 10 Array ( [index] => 5 [login] => 2 [pricing] => 2 [documentation] => 2 [support] => 1 [signup] => 2 ) Array ( [index] => 6 [login] => 11 [pricing] => 11 [documentation] => 12 [support] => 10 [signup] => 11 ) Array ( [index] => 0 [login] => 0 [pricing] => 0 [documentation] => 0 [support] => 0 [signup] => 0 )
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.0.14
Array ( [index] => 5 [login] => 2 [pricing] => 2 [documentation] => 2 [support] => 1 [signup] => 2 ) Array ( [index] => 6 [login] => 11 [pricing] => 11 [documentation] => 12 [support] => 10 [signup] => 11 ) Array ( [index] => 0 [login] => 0 [pricing] => 0 [documentation] => 0 [support] => 0 [signup] => 0 )
Output for hhvm-3.10.0

Process exited with code 153.