Annotation of embedaddon/php/ext/standard/tests/class_object/get_declared_classes_variation1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test get_declared_classes() function : testing autoloaded classes
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:
12: echo "*** Testing get_declared_classes() : testing autoloaded classes ***\n";
13:
14: function __autoload($class_name) {
15: require_once $class_name . '.inc';
16: }
17:
18: echo "\n-- before instance is declared --\n";
19: var_dump(in_array('AutoLoaded', get_declared_classes()));
20:
21: echo "\n-- after instance is declared --\n";
22: $class = new AutoLoaded();
23: var_dump(in_array('AutoLoaded', get_declared_classes()));
24:
25: echo "\nDONE\n";
26:
27: ?>
28: --EXPECTF--
29: *** Testing get_declared_classes() : testing autoloaded classes ***
30:
31: -- before instance is declared --
32: bool(false)
33:
34: -- after instance is declared --
35: bool(true)
36:
37: DONE
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>