1--TEST--
2SPL: Test class_implements() function : basic
3--FILE--
4<?php
5echo "*** Testing class_implements() : basic ***\n";
6
7
8interface foo { }
9class fooImpl implements foo {}
10
11interface bar { }
12class barImpl implements bar {}
13
14class foobarImpl implements foo, bar {}
15
16class fooViaBarImpl extends barImpl implements foo {}
17
18class fooExtended extends fooImpl {}
19
20s_var_dump(class_implements(new foobarImpl));
21s_var_dump(class_implements('foobarImpl'));
22s_var_dump(class_implements(new fooViaBarImpl));
23s_var_dump(class_implements('fooViaBarImpl'));
24s_var_dump(class_implements(new fooExtended));
25s_var_dump(class_implements('fooExtended'));
26
27
28function s_var_dump($arr) {
29   krsort($arr);
30   var_dump($arr);
31}
32?>
33--EXPECT--
34*** Testing class_implements() : basic ***
35array(2) {
36  ["foo"]=>
37  string(3) "foo"
38  ["bar"]=>
39  string(3) "bar"
40}
41array(2) {
42  ["foo"]=>
43  string(3) "foo"
44  ["bar"]=>
45  string(3) "bar"
46}
47array(2) {
48  ["foo"]=>
49  string(3) "foo"
50  ["bar"]=>
51  string(3) "bar"
52}
53array(2) {
54  ["foo"]=>
55  string(3) "foo"
56  ["bar"]=>
57  string(3) "bar"
58}
59array(1) {
60  ["foo"]=>
61  string(3) "foo"
62}
63array(1) {
64  ["foo"]=>
65  string(3) "foo"
66}
67