3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function edit_distance_ond($str1 ,$str2){ $array = array(); $x; $y; $offset = count($str1); $array[$offset + 1] = 0; for($D = 0; $D <= count($str1) + count($str2); $D++){ for($k = -$D; $k <= $D; k += 2){ if($k == -$D || $k != $D && $array[$k-1+$offset] < $array[$k+1+$offset]) $x = $array[$k+1+$offset]; else $x = $array[$k-1+$offset] + 1; $y = $x - $k; while($x < count($str1) && $y < count($str2) && $str1[$x] == $str2[$y]){ $x++; $y++; } $array[$k+$offset] = $x; if($x >= count($str1) && $y >= count($str2)) return $D; } } return -1; } ?>
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '+=' (T_PLUS_EQUAL), expecting ')' in /in/lXvun on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PLUS_EQUAL, expecting ')' in /in/lXvun on line 9
Process exited with code 255.