1--TEST--
2SPL: Test class_implements() function : basic
3--FILE--
4<?php
5/* Prototype  : array class_implements(mixed what [, bool autoload ])
6 * Description: Return all classes and interfaces implemented by SPL
7 * Source code: ext/spl/php_spl.c
8 * Alias to functions:
9 */
10
11echo "*** Testing class_implements() : basic ***\n";
12
13
14interface foo { }
15class fooImpl implements foo {}
16
17interface bar { }
18class barImpl implements bar {}
19
20class foobarImpl implements foo, bar {}
21
22class fooViaBarImpl extends barImpl implements foo {}
23
24class fooExtended extends fooImpl {}
25
26s_var_dump(class_implements(new foobarImpl));
27s_var_dump(class_implements('foobarImpl'));
28s_var_dump(class_implements(new fooViaBarImpl));
29s_var_dump(class_implements('fooViaBarImpl'));
30s_var_dump(class_implements(new fooExtended));
31s_var_dump(class_implements('fooExtended'));
32
33
34function s_var_dump($arr) {
35   krsort($arr);
36   var_dump($arr);
37}
38?>
39===DONE===
40--EXPECT--
41*** Testing class_implements() : basic ***
42array(2) {
43  ["foo"]=>
44  string(3) "foo"
45  ["bar"]=>
46  string(3) "bar"
47}
48array(2) {
49  ["foo"]=>
50  string(3) "foo"
51  ["bar"]=>
52  string(3) "bar"
53}
54array(2) {
55  ["foo"]=>
56  string(3) "foo"
57  ["bar"]=>
58  string(3) "bar"
59}
60array(2) {
61  ["foo"]=>
62  string(3) "foo"
63  ["bar"]=>
64  string(3) "bar"
65}
66array(1) {
67  ["foo"]=>
68  string(3) "foo"
69}
70array(1) {
71  ["foo"]=>
72  string(3) "foo"
73}
74===DONE===
75