xref: /PHP-5.5/Zend/tests/017.phpt (revision dcfe5d71)
1--TEST--
2builtin functions tests
3--FILE--
4<?php
5
6var_dump(get_resource_type());
7var_dump(get_resource_type(""));
8$fp = fopen(__FILE__, "r");
9var_dump(get_resource_type($fp));
10fclose($fp);
11var_dump(get_resource_type($fp));
12
13var_dump(gettype(get_loaded_extensions()));
14var_dump(count(get_loaded_extensions()));
15var_dump(gettype(get_loaded_extensions(true)));
16var_dump(count(get_loaded_extensions(true)));
17var_dump(get_loaded_extensions(true, true));
18
19define("USER_CONSTANT", "test");
20
21var_dump(get_defined_constants(true, true));
22var_dump(gettype(get_defined_constants(true)));
23var_dump(gettype(get_defined_constants()));
24var_dump(count(get_defined_constants()));
25
26function test () {
27}
28
29var_dump(get_defined_functions(true));
30var_dump(gettype(get_defined_functions()));
31var_dump(count(get_defined_functions()));
32
33var_dump(get_declared_interfaces(true));
34var_dump(gettype(get_declared_interfaces()));
35var_dump(count(get_declared_interfaces()));
36
37var_dump(get_extension_funcs());
38var_dump(get_extension_funcs(true));
39var_dump(gettype(get_extension_funcs("standard")));
40var_dump(count(get_extension_funcs("standard")));
41var_dump(gettype(get_extension_funcs("zend")));
42var_dump(count(get_extension_funcs("zend")));
43
44
45echo "Done\n";
46?>
47--EXPECTF--
48Warning: get_resource_type() expects exactly 1 parameter, 0 given in %s on line %d
49NULL
50
51Warning: get_resource_type() expects parameter 1 to be resource, string given in %s on line %d
52NULL
53string(6) "stream"
54string(7) "Unknown"
55string(5) "array"
56int(%d)
57string(5) "array"
58int(%d)
59
60Warning: get_loaded_extensions() expects at most 1 parameter, 2 given in %s on line %d
61NULL
62
63Warning: get_defined_constants() expects at most 1 parameter, 2 given in %s on line %d
64NULL
65string(5) "array"
66string(5) "array"
67int(%d)
68
69Warning: get_defined_functions() expects exactly 0 parameters, 1 given in %s on line %d
70NULL
71string(5) "array"
72int(%d)
73
74Warning: get_declared_interfaces() expects exactly 0 parameters, 1 given in %s on line %d
75NULL
76string(5) "array"
77int(%d)
78
79Warning: get_extension_funcs() expects exactly 1 parameter, 0 given in %s on line %d
80NULL
81bool(false)
82string(5) "array"
83int(%d)
84string(5) "array"
85int(%d)
86Done
87