1--TEST--
2Test get_declared_interfaces() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : proto array get_declared_interfaces()
6 * Description: Returns an array of all declared interfaces.
7 * Source code: Zend/zend_builtin_functions.c
8 * Alias to functions:
9 */
10
11
12echo "*** Testing get_declared_interfaces() : basic functionality ***\n";
13
14// Zero arguments
15echo "\n-- Testing get_declared_interfaces() function with Zero arguments --\n";
16var_dump(get_declared_interfaces());
17
18foreach (get_declared_interfaces() as $interface) {
19	if (!interface_exists($interface)) {
20		echo "Error: $interface is not a valid interface.\n";
21	}
22}
23
24echo "\n-- Ensure userspace classes are not listed --\n";
25Class C {}
26var_dump(in_array('C', get_declared_interfaces()));
27
28echo "\n-- Ensure userspace interfaces are listed --\n";
29Interface I {}
30var_dump(in_array('I', get_declared_interfaces()));
31
32echo "Done";
33?>
34--EXPECTF--
35*** Testing get_declared_interfaces() : basic functionality ***
36
37-- Testing get_declared_interfaces() function with Zero arguments --
38array(%d) {
39%a
40}
41
42-- Ensure userspace classes are not listed --
43bool(false)
44
45-- Ensure userspace interfaces are listed --
46bool(true)
47Done
48