2
Test get_defined_constants() function : basic functionality
5
/* Prototype : array get_defined_constants ([ bool $categorize ] )
6
* Description: Returns an associative array with the names of all the constants and their values
7
* Source code: Zend/zend_builtin_functions.c
10
echo "*** Testing get_defined_constants() : basic functionality ***\n";
12
var_dump(gettype(get_defined_constants(true)));
13
var_dump(gettype(get_defined_constants()));
15
$arr1 = get_defined_constants(false);
16
$arr2 = get_defined_constants();
17
var_dump(array_diff($arr1, $arr2));
19
$n1 = count(get_defined_constants());
20
define("USER_CONSTANT", "test");
21
$arr2 = get_defined_constants();
24
if ($n2 == $n1 + 1 && array_key_exists("USER_CONSTANT", $arr2)) {
33
*** Testing get_defined_constants() : basic functionality ***
b'\\ No newline at end of file'