Annotation of embedaddon/php/ext/spl/tests/class_implements_basic2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: 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:
11: echo "*** Testing class_implements() : basic ***\n";
12:
13:
14: interface foo { }
15: class fooImpl implements foo {}
16:
17: interface bar { }
18: class barImpl implements bar {}
19:
20: class foobarImpl implements foo, bar {}
21:
22: class fooViaBarImpl extends barImpl implements foo {}
23:
24: class fooExtended extends fooImpl {}
25:
26: s_var_dump(class_implements(new foobarImpl));
27: s_var_dump(class_implements('foobarImpl'));
28: s_var_dump(class_implements(new fooViaBarImpl));
29: s_var_dump(class_implements('fooViaBarImpl'));
30: s_var_dump(class_implements(new fooExtended));
31: s_var_dump(class_implements('fooExtended'));
32:
33:
34: function s_var_dump($arr) {
35: krsort($arr);
36: var_dump($arr);
37: }
38: ?>
39: ===DONE===
40: --EXPECT--
41: *** Testing class_implements() : basic ***
42: array(2) {
43: ["foo"]=>
44: string(3) "foo"
45: ["bar"]=>
46: string(3) "bar"
47: }
48: array(2) {
49: ["foo"]=>
50: string(3) "foo"
51: ["bar"]=>
52: string(3) "bar"
53: }
54: array(2) {
55: ["foo"]=>
56: string(3) "foo"
57: ["bar"]=>
58: string(3) "bar"
59: }
60: array(2) {
61: ["foo"]=>
62: string(3) "foo"
63: ["bar"]=>
64: string(3) "bar"
65: }
66: array(1) {
67: ["foo"]=>
68: string(3) "foo"
69: }
70: array(1) {
71: ["foo"]=>
72: string(3) "foo"
73: }
74: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>