1--TEST--
2similar_text(), basic tests
3--CREDITS--
4Mats Lindh <mats at lindh.no>
5#Testfest php.no
6--INI--
7precision=14
8--FILE--
9<?php
10/* Prototype  : proto int similar_text(string str1, string str2 [, float percent])
11* Description: Calculates the similarity between two strings
12* Source code: ext/standard/string.c
13*/
14var_dump(similar_text("abcdefgh", "efg"));
15var_dump(similar_text("abcdefgh", "mno"));
16var_dump(similar_text("abcdefghcc", "c"));
17var_dump(similar_text("abcdefghabcdef", "zzzzabcdefggg"));
18
19$percent = 0;
20similar_text("abcdefgh", "efg", $percent);
21var_dump($percent);
22similar_text("abcdefgh", "mno", $percent);
23var_dump($percent);
24similar_text("abcdefghcc", "c", $percent);
25var_dump($percent);
26similar_text("abcdefghabcdef", "zzzzabcdefggg", $percent);
27var_dump($percent);
28?>
29===DONE===
30--EXPECT--
31int(3)
32int(0)
33int(1)
34int(7)
35float(54.545454545455)
36float(0)
37float(18.181818181818)
38float(51.851851851852)
39===DONE===
40