1--TEST--
2Test get_include_files() function
3--INI--
4include_path=.
5--FILE--
6<?php
7/* Prototype: array get_included_files  ( void  )
8 * Description: Returns an array with the names of included or required files
9
10*/
11
12echo "*** Testing get_included_files()\n";
13
14echo "\n-- List included files at start --\n";
15var_dump(get_included_files());
16
17include(dirname(__FILE__)."/get_included_files_inc1.inc");
18echo "\n-- List included files atfter including inc1 -\n";
19var_dump(get_included_files());
20
21include(dirname(__FILE__)."/get_included_files_inc2.inc");
22echo "\n-- List included files atfter including inc2 which will include inc3 which includes inc1 --\n";
23var_dump(get_included_files());
24
25echo "\n-- Error cases --\n";
26var_dump(get_included_files(true));
27
28?>
29===DONE===
30--EXPECTF--
31*** Testing get_included_files()
32
33-- List included files at start --
34array(1) {
35  [0]=>
36  string(%d) "%sget_included_files.php"
37}
38
39-- List included files atfter including inc1 -
40array(2) {
41  [0]=>
42  string(%d) "%sget_included_files.php"
43  [1]=>
44  string(%d) "%sget_included_files_inc1.inc"
45}
46
47-- List included files atfter including inc2 which will include inc3 which includes inc1 --
48array(4) {
49  [0]=>
50  string(%d) "%sget_included_files.php"
51  [1]=>
52  string(%d) "%sget_included_files_inc1.inc"
53  [2]=>
54  string(%d) "%sget_included_files_inc2.inc"
55  [3]=>
56  string(%d) "%sget_included_files_inc3.inc"
57}
58
59-- Error cases --
60
61Warning: get_included_files() expects exactly 0 parameters, 1 given in %s on line %d
62NULL
63===DONE===
64