xref: /PHP-5.6/ext/spl/tests/class_uses_basic.phpt (revision dca6f950)
1--TEST--
2SPL: Test class_implements() function : basic
3--FILE--
4<?php
5/* Prototype  : array class_uses(mixed what [, bool autoload ])
6 * Description: Return all traits used by a class
7 * Source code: ext/spl/php_spl.c
8 * Alias to functions:
9 */
10
11echo "*** Testing class_uses() : basic ***\n";
12
13
14trait foo { }
15class bar { use foo; }
16
17var_dump(class_uses(new bar));
18var_dump(class_uses('bar'));
19
20
21?>
22===DONE===
23--EXPECT--
24*** Testing class_uses() : basic ***
25array(1) {
26  ["foo"]=>
27  string(3) "foo"
28}
29array(1) {
30  ["foo"]=>
31  string(3) "foo"
32}
33===DONE===
34