1--TEST--
2get_defined_functions() function : basic functionality
3--FILE--
4<?php
5
6echo "*** Testing get_defined_functions() : basic functionality ***\n";
7
8function foo() {}
9
10// mixed case function
11function HelloWorld() {}
12
13Class C {
14    function f1() {}
15    static function f2() {}
16}
17
18$func = get_defined_functions();
19
20if (!is_array($func)) {
21    echo "TEST FAILED: return type not an array\n";
22}
23
24
25if (!is_array($func["internal"])) {
26    echo "TEST FAILED: no element in result array with key 'internal'\n";
27}
28
29$internal = $func["internal"];
30
31//check for a few core functions
32if (!in_array("cos", $internal) || !in_array("strlen", $internal)) {
33    echo "TEST FAILED: missing elements from 'internal' array\n";
34    var_dump($internal);
35}
36
37if (!is_array($func["user"])) {
38    echo "TEST FAILED: no element in result array with key 'user'\n";
39}
40
41$user = $func["user"];
42if (count($user) == 2 && in_array("foo", $user) && in_array("helloworld", $user)) {
43    echo "TEST PASSED\n";
44} else {
45    echo "TEST FAILED: missing elements from 'user' array\n";
46    var_dump($user);
47}
48
49?>
50--EXPECT--
51*** Testing get_defined_functions() : basic functionality ***
52TEST PASSED
53