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